dio_cache_plus 1.0.1
dio_cache_plus: ^1.0.1 copied to clipboard
Enhanced Dio caching interceptor with per-request control, conditional caching, and expiration.
0.0.1 #
- Initial release of Dio Cache Plus.
1.0.0 #
Breaking Changes #
- Changed constructor parameters from positional to named arguments in
DioCachePlusInterceptor:- Added required
isErrorResponsefunction parameter to verify and skip caching of failed responses - Changed
cacheAllto named parameter - Changed
commonCacheDurationto named parameter
- Added required
- Changed
enableCachefrom positional to named optional argument in thesetCachingmethod - Updated Dio dependency support to
^5.8.0while maintaining 4.x compatibility
Major Features #
isErrorResponsePredicate - Core functionality that enables intelligent caching by:- Preventing storage of failed API responses
- Allowing custom failure detection logic (e.g., status codes, error payloads)
- Essential for maintaining cache integrity
- Improved API with named parameters for better readability and explicit configuration
Why These Changes? #
- The
isErrorResponseparameter is now mandatory as it's critical for:- Preventing cache pollution with error states
- Ensuring only valid responses are stored
- Supporting custom API failure detection
- Named parameters provide:
- Self-documenting API usage
- Safer refactoring
- Better IDE support