network_cache_interceptor 2.3.5
network_cache_interceptor: ^2.3.5 copied to clipboard
NetworkCacheInterceptor is a custom interceptor designed to optimize network requests by integrating caching functionality into your application using the Dio library.
Changelog #
2.3.5 Updated #
Added #
- No-Cache HTTP Methods Option:
- Developers can now specify HTTP methods (e.g.,
POST,PUT) that should not be cached, giving finer control over caching logic.
- Developers can now specify HTTP methods (e.g.,
Changed #
- Enhanced Offline Mode:
- Now leverages
DioExceptionType.connectionErrorto detect offline scenarios and return cached data reliably.
- Now leverages
Fixed #
- Improved handling of
unique_keyand request headers in cache key generation for consistent and reliable caching.
2.3.4 Updated #
Changed #
- Caching Logic Improvement:
GETrequests are now cached by default, even ifcache: falseis explicitly specified.- Introduced
uniqueWithHeaderparameter to allow caching differentiation based on request headers. - Added better handling of
unique_keyfor more precise cache invalidation. AuthorizationandUser-Agentheaders are now ignored when generating cache keys to prevent unnecessary cache invalidation.
Fixed #
- Improved database synchronization to avoid data loss on unexpected crashes.
- Enhanced caching mechanism to reduce duplicate entries.
- Optimized cache key generation to ensure consistency and prevent mismatches.
1.2.4 Updated #
Changed #
- Caching Logic Improvement:
- All
GETrequests are now cached by default, even ifcache: falseis explicitly specified. - Added more precise control through request
extraparameters for cache behavior.
- All
Fixed #
- Improved database synchronization to avoid data loss on unexpected crashes.
- Enhanced caching mechanism to reduce duplicate entries.
1.0.0 Initial Release #
Added #
- Introduced
NetworkCacheInterceptorfor caching Dio network requests. - Added support for automatic caching and retrieval when offline.
- Included custom cache configuration:
noCacheStatusCodes: Prevents caching for specific status codes.cacheValidityMinutes: Controls cache expiration time.getCachedDataWhenError: Enables cache retrieval on network errors.
- Implemented local SQL-based storage for cached responses.
- Integrated error logging for easier debugging.
Features #
- Automatic request caching when enabled.
- Cache-based response retrieval if the network is unavailable.
- Customizable caching rules through extra request parameters.
- Database management methods like
clearDatabase().
Future Improvements (Planned) #
- Add support for custom cache storage engines.
- Include cache statistics and monitoring features.
- Expand request matching capabilities (query parameters and headers).