karna_network 0.1.0
karna_network: ^0.1.0 copied to clipboard
A stale-while-revalidate (SWR) caching layer for Dio: serves cached GET responses instantly, revalidates in the background, dedupes concurrent requests, and falls back to stale data on network failure.
0.1.0 #
- Initial release.
- SWR Caching (
SwrInterceptor): stale-while-revalidate caching layer with ETag / 304 Not Modified support and request deduplication. - In-Memory LRU Store (
MemoryCacheStore): default in-memory cache store with configurable capacity. - Hive CE Persistent Stores (
HiveCacheStore,HiveMutationQueueStore): built-in persistent storage for SWR cache and offline mutations usinghive_cewith standard Map serialization. - Pluggable Cache Storage (
SwrCacheStore): abstract interface for custom storage backends. - Auth Interceptor (
AuthInterceptor): token attachment, automatic single-flight refresh on 401, and transparent retry. - Retry & Circuit Breaker (
RetryInterceptor,CircuitBreaker): exponential backoff for retryable requests and fast-failing circuit breaker. - Error Normalization (
ErrorNormalizingInterceptor,AppError): mapsDioExceptiontypes to structuredAppErrorinstances. - Request Batching (
BatchCollector): coalesces concurrent single-resource requests into a single batch query. - Offline Mutation Queue (
OfflineMutationQueue): queues non-GET mutations while offline and flushes upon reconnection. - Request Aggregation (
RequestAggregator): fires multiple GET requests in parallel through Dio.