karna_network 0.1.0 copy "karna_network: ^0.1.0" to clipboard
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 using hive_ce with 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): maps DioException types to structured AppError instances.
  • 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.
0
likes
150
points
88
downloads

Documentation

API reference

Publisher

verified publisheraramadani.my.id

Weekly Downloads

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.

Repository (GitHub)
View/report issues

Topics

#dio #cache #swr #networking #http

License

MIT (license)

Dependencies

dio, hive_ce

More

Packages that depend on karna_network