dio_cache_plus 2.0.3
dio_cache_plus: ^2.0.3 copied to clipboard
Enhanced Dio caching interceptor with per-request control, conditional caching, and expiration.
Changelog #
All notable changes to Dio Cache Plus will be documented in this file.
2.0.3 2025-Nov-04 #
Fixed #
- Query parameters extraction - Properly merge query parameters from both URL string and request options
- Conditional rule matching - Use complete query parameters for accurate request pattern matching
- Cache consistency - Ensure parameterized requests are correctly identified for caching rules
2.0.2 2025-Nov-03 #
Added #
- Conditional cache data removal - New
removeConditionalCachingData()method to remove cached data based on request patterns
2.0.1 2025-Oct-28 #
Optimizations #
- Skip caching when validity duration is zero or null
- Prevent duplicate cache overwriting from cached responses
- Preserve extra map reference in request options
2.0.0 2025-Oct-27 #
🚀 Major Enhancements #
- Dynamic function support for duration and expiry calculations
durationFnparameter for dynamic duration calculation at cache timeexpiryFnparameter for dynamic expiry calculation at cache time
- Factory constructors for
ConditionalCacheRulefor better type safety - Enhanced CacheOptionsExtension with type-safe methods
- RequestDetails class for better type safety in condition matching
- Comprehensive test suite with 100% test coverage for all major features
⚠️ Breaking Changes #
RequestMatchersignature now usesRequestDetailsobject instead of separate parameters- Old:
(String requestUrl, Map<String, dynamic> queryParameters) => ... - New:
(RequestDetails request) => request.url.contains(...)
- Old:
- Conditional caching API now requires
ConditionalCacheRuleobjects- Old:
addConditionalCaching(key, condition, duration) - New:
addConditionalCaching(key, ConditionalCacheRule.duration(...))
- Old:
- Per-request caching methods are now type-specific
- Old:
setCaching(enableCache: true, duration: ...) - New:
setCachingWithDuration(enableCache: true, duration: ...)
- Old:
For detailed migration instructions, see Migration Guide
🔧 Improvements #
- Enhanced cache expiry calculation to happen at storage time for precise timing
- Improved caching logic precedence with more intuitive rule evaluation
- Better error handling throughout the interceptor
- Comprehensive test coverage ensuring reliability and stability
1.0.2 2025-Aug-16 #
Fixed #
- Cache invalidation issues with force refresh
- Request deduplication edge cases
- Hive storage initialization race conditions