dio_cache_interceptor
Dio HTTP cache interceptor with multiple stores respecting HTTP directives (or not).
4.0.7
221K downloads/mo
#813 most downloaded on pub.dev
llfbandit/dart_http_cache
What this package is like to depend on
Last release 1 months ago
26 Jun 2026
Release timing varies
gaps range from 9 days to 13 months
Nearly every release is documented
notes for 44 of 48 stable releases
Nothing withdrawn
no release was ever pulled
6 years old
56 releases · first in 2020
4 releases in the last 12 months
see the full history below
Release timeline
56 releases · Sep 2020 to Jun 2026Releases
latest 56-
4.0.726 Jun 2026Release notes
Open source →- perf: skip store write in _updateCacheResponse when maxStale is still half-window fresh
- fix: remove DioBaseRequest constructor mutation of RequestOptions.headers
- fix: make CacheResponse.content and headers final to prevent stale _cachedHeaders
- fix: strip if-none-match/if-modified-since from headers before invoking keyBuilder
- fix: guard against null requestDate when DioCacheInterceptor.onRequest is bypassed
- fix: skip storing a 304 response when no cached entry exists to update
- fix: wrap interceptor handlers in try/catch to prevent hangs on store exceptions
- refactor: remove dead else branch in onRequest conditional request dispatch
-
4.0.620 Mar 2026Release notes
Open source →- fix: Age header refresh on 304 revalidation
- chore: Min SDK is now 3.6.0.
-
4.0.503 Oct 2025 -
4.0.430 Sep 2025 -
4.0.302 Apr 2025Release notes
Open source →- fix: BaseRequest now has
headersgetter instead ofheaderValuesAsList. - chore: Updated dependencies.
Release notes
Open source →-
fix: BaseRequest now has headers getter instead of headerValuesAsList .
-
chore: Updated dependencies.
- fix: BaseRequest now has
-
4.0.229 Mar 2025 -
4.0.128 Mar 2025Release notes
Open source →- fix: Improve cache save time.
- fix:
CacheOptions#maxStaleusage may lead to empty response body. - feat: Improve performance on cache check when using cipher.
Release notes
Open source →-
fix: Improve cache save time.
-
fix: CacheOptions#maxStale usage may lead to empty response body.
-
feat: Improve performance on cache check when using cipher.
-
4.0.027 Mar 2025Release notes
Open source →- chore: Reworked package to be only a
diointerceptor. Leaving space to do the same withhttppackage or others. - feat: ** BREAKING ** Stores save response status codes.
- Store migration is implicit, you have nothing to do.
- 304 may still be forwarded for older cached responses.
- feat: ** BREAKING **
hitCacheOnErrorExceptis split withhitCacheOnNetworkFailure. Term is now positive and replaced byhitCacheOnErrorCodes. - feat: Add
hitCacheOnNetworkFailureto allow restore previous cached response on network failure (connection, TO, ...). - chore: Stores are now fully agnostic and don't rely on
dio_cache_interceptorpackage. - chore: Source code cleanup.
- chore: Min SDK is now 3.0.0.
- chore: Updated dependencies.
Release notes
Open source →-
chore: Reworked package to be only a dio interceptor. Leaving space to do the same with http package or others.
-
feat: ** BREAKING ** Stores save response status codes.
-
Store migration is implicit, you have nothing to do.
-
304 may still be forwarded for older cached responses.
-
feat: ** BREAKING ** hitCacheOnErrorExcept is split with hitCacheOnNetworkFailure . Term is now positive and replaced by hitCacheOnErrorCodes .
-
feat: Add hitCacheOnNetworkFailure to allow restore previous cached response on network failure (connection, TO, ...).
-
chore: Stores are now fully agnostic and don't rely on dio_cache_interceptor package.
-
chore: Source code cleanup.
-
chore: Min SDK is now 3.0.0.
-
chore: Updated dependencies.
- chore: Reworked package to be only a
-
3.5.108 Dec 2024Release notes
Open source →- fix: Allow
"in header values. - chore: Some more tests added.
- chore: Updated README.md.
Release notes
Open source →-
fix: Allow " in header values.
-
chore: Some more tests added.
-
chore: Updated README.md.
- fix: Allow
-
3.5.027 Nov 2023Release notes
Open source →- chore: Updated dependencies.
- chore: Updated example.
- feat: Isar added as store.
- feat: Status 304 is now managed when set as valid status.
-
3.4.429 Sep 2023 -
3.4.325 Sep 2023Release notes
Open source →- fix: Correctly serialize null content responses.
- chore: explicitly allow dart 3.
- chore: Now requires Dio >= 5.2.0+1.
-
3.4.206 Apr 2023Release notes
Open source →- fix: Headers were not saved/restored in/from
CacheResponse. - fix: Cache trigger now enabled again with
expires,Cache-Control/max-age. - feat: Add few new status codes available for caching: 404, 405 and 501.
- chore: Few code improvements.
Release notes
Open source →-
fix: Headers were not saved/restored in/from CacheResponse .
-
fix: Cache trigger now enabled again with expires , Cache-Control / max-age .
-
feat: Add few new status codes available for caching: 404, 405 and 501.
-
chore: Few code improvements.
- fix: Headers were not saved/restored in/from
-
3.4.128 Mar 2023Release notes
Open source →- chore: Ensure header values are join when there's comma (,) in the value (date, expires, last-modified, etag). Dio may or may not understand headers with single value (i.e.: 'Wed, 21 Oct 2015 07:28:00 GMT').
-
3.4.022 Feb 2023 -
3.3.101 Sep 2022Release notes
Open source →- fix: pathExists queryParams are not checked correctly (thanks to @clragon)
-
3.3.008 Jul 2022Release notes
Open source →- feat: Add
Store.getFromPathmethod. - feat: Add
Store.deleteFromPathmethod.
Those two methods allow advanced manipulation of entries in store.
Ensure to be restrictive when using it.
Release notes
Open source →-
feat: Add Store.getFromPath method.
-
feat: Add Store.deleteFromPath method. Those two methods allow advanced manipulation of entries in store. Ensure to be restrictive when using it.
- feat: Add
-
3.2.725 Apr 2022Release notes
Open source →- fix: read/write when cipher is used.
- core: Avoids some roundtrips resulting in improved performance.
- feat: (Re-)introduce
copyWithonCacheResponse. - core: Remove Android example deprecations.
Release notes
Open source →-
fix: read/write when cipher is used.
-
core: Avoids some roundtrips resulting in improved performance.
-
feat: (Re-)introduce copyWith on CacheResponse .
-
core: Remove Android example deprecations.
-
3.2.625 Feb 2022 -
3.2.518 Feb 2022Release notes
Open source →- fix: Cache control parsing on request. Dio request headers are not of type
Headers.
Release notes
Open source →- fix: Cache control parsing on request. Dio request headers are not of type Headers .
- fix: Cache control parsing on request. Dio request headers are not of type
-
3.2.416 Feb 2022 -
3.2.315 Feb 2022Release notes
Open source →- Breaking feat:
CacheOptions.copyWithnow requiresNullablefor some parameters to allownullvalues. - fix: Since version 3.2.0, when
maxStalewas set on global options, it was necessary to re-create the dedicatedCacheOptionsfor the request to avoid postponing. You can now use the changed copyWith to do that. - fix:
MemCacheStore.closenow clears all entries. - fix: size computation of entry bytes in
MemCacheStore.
Release notes
Open source →-
Breaking feat: CacheOptions.copyWith now requires Nullable for some parameters to allow null values.
-
fix: Since version 3.2.0, when maxStale was set on global options, it was necessary to re-create the dedicated CacheOptions for the request to avoid postponing. You can now use the changed copyWith to do that.
-
fix: MemCacheStore.close now clears all entries.
-
fix: size computation of entry bytes in MemCacheStore .
- Breaking feat:
-
3.2.207 Jan 2022Release notes
Open source →- fix: stream response type is no more eligible to cache (wasn't working anyway). This is additional fix to
content-disposition: attachment; ...since headers may not be set.
Release notes
Open source →- fix: stream response type is no more eligible to cache (wasn't working anyway). This is additional fix to content-disposition: attachment; ... since headers may not be set.
- fix: stream response type is no more eligible to cache (wasn't working anyway). This is additional fix to
-
3.2.107 Jan 2022 -
3.2.007 Jan 2022Release notes
Open source →Warning, this version is considered compatible with previous versions about stored data.
However, cache store entries have now a new field for request date persistence which is setup arbitrarily for backward compatibility (150ms before response receive time).
Depending of your usage, cache beheviour could be a bit inaccurate while entries are not updated with new strategy algorithm.
If this is critical for your app, consider to clean up your store by callingstore.clean();for example on your next app upgrade.- feat: More status codes (203, 301) are available for caching responses.
- feat: Status codes (302 are 307) are available for caching responses under strict conditions.
- feat: Lots of improvements in computation of response expiry. Package is now much more compliant with
rfc7234. - feat:
age,max-stale,min-fresh,must-revalidateheaders/values are now parsed. - feat: When
maxStaleis given to the request, interceptor will now add/update it from the current date for a previously cached response. This lets you get more control to postpone the deletion if needed. - fix: stale state is now handled in interceptor instead of cache stores.
- fix:
no-cacheheader is now correctly handled. - fix:
content-disposition: attachment; ...is no more eligible to be cached. - core: General code cleanup to handle above features.
Release notes
Open source →Warning, this version is considered compatible with previous versions about stored data. However, cache store entries have now a new field for request date persistence which is setup arbitrarily for backward compatibility (150ms before response receive time). Depending of your usage, cache beheviour could be a bit inaccurate while entries are not updated with new strategy algorithm. If this is critical for your app, consider to clean up your store by calling store.clean(); for example on your next app upgrade.
-
feat: More status codes (203, 301) are available for caching responses.
-
feat: Status codes (302 are 307) are available for caching responses under strict conditions.
-
feat: Lots of improvements in computation of response expiry. Package is now much more compliant with rfc7234 .
-
feat: age , max-stale , min-fresh , must-revalidate headers/values are now parsed.
-
feat: When maxStale is given to the request, interceptor will now add/update it from the current date for a previously cached response. This lets you get more control to postpone the deletion if needed.
-
fix: stale state is now handled in interceptor instead of cache stores.
-
fix: no-cache header is now correctly handled.
-
fix: content-disposition: attachment; ... is no more eligible to be cached.
-
core: General code cleanup to handle above features.
-
3.1.027 Dec 2021Release notes
Open source →- Breaking: File cache store is now available as external package and suitable for production.
- Improved example with added non-cached content & image provider sample.
Release notes
Open source →-
Breaking : File cache store is now available as external package and suitable for production.
-
Improved example with added non-cached content & image provider sample.
-
3.0.322 Nov 2021Release notes
Open source →- fix: Cipher file export.
- feat: Add ObjectBox store (All credits go to cmengler).
Release notes
Open source →-
fix: Cipher file export.
-
feat: Add ObjectBox store (All credits go to cmengler ).
-
3.0.201 Oct 2021 -
3.0.101 Jul 2021 -
3.0.022 Jun 2021Release notes
Open source →- core: Moved DB & Hive cache stores to their respective packages.
- fix: import of file_cache_store.
-
2.3.107 May 2021 -
2.3.003 May 2021 -
2.2.020 Apr 2021Release notes
Open source →- feat: Cache-Control: max-age as cache trigger added.
- core: update README.md.
-
2.1.116 Apr 2021Release notes
Open source →- fix: refreshForceCache policy added. Get parity with refresh/request and refreshForceCache/forceCache.
-
2.1.015 Apr 2021 -
2.0.029 Mar 2021Release notes
Open source →- core: Update dio to 4.0.0.
- Renamed
cacheStoreForcetoforceCache. - Renamed
cacheStoreNotonoCache. - Make
CacheOptions.storerequired but still with optional value.
Release notes
Open source →-
core: Update dio to 4.0.0.
-
Renamed cacheStoreForce to forceCache .
-
Renamed cacheStoreNo to noCache .
-
Make CacheOptions.store required but still with optional value.
-
2.0.0-rc.118 Mar 2021 pre-releaseRelease notes
Open source →- core: Update dio to 4.0.0-prev1.
- fix: update cache header values on 304 (keeping in sync freshness of our cache content).
- fix: return cache on socket exception with hitCacheOnErrorExcept.
- fix: date header parsing exception not catched.
-
2.0.0-beta.709 Mar 2021 pre-releaseRelease notes
Open source →- core: Update dio to 4.0.0-beta7.
- Breaking: Remove now useless/confusing
cacheFirstpolicy with improved freshness checks. - Breaking: Rename
requestFirsttorequest. - Small code improvements.
- Update README.MD
Release notes
Open source →-
core: Update dio to 4.0.0-beta7.
-
Breaking : Remove now useless/confusing cacheFirst policy with improved freshness checks.
-
Breaking : Rename requestFirst to request .
-
Small code improvements.
-
Update README.MD
-
2.0.0-beta.607 Mar 2021 pre-releaseRelease notes
Open source →- core: Update dio to 4.0.0-beta6.
- Small code improvement / clean-up.
- Feat: Add boolean
fromNetworkto extra inResponse. - Fix: Cache-Control max-age precedence over Expires header.
- Completed test coverage.
- Now waiting for Dio to get out of beta stage or issue reports!
Release notes
Open source →-
core: Update dio to 4.0.0-beta6.
-
Small code improvement / clean-up.
-
Feat: Add boolean fromNetwork to extra in Response .
-
Fix: Cache-Control max-age precedence over Expires header.
-
Completed test coverage.
-
Now waiting for Dio to get out of beta stage or issue reports!
-
2.0.0-beta.505 Mar 2021 pre-releaseRelease notes
Open source →- core: Update dio to 4.0.0-beta5.
- Wrap decrypt/encrypt functions to
CacheCipher. - Add decent test coverage (still WIP).
Release notes
Open source →-
core: Update dio to 4.0.0-beta5.
-
Wrap decrypt/encrypt functions to CacheCipher .
-
Add decent test coverage (still WIP).
-
2.0.0-beta.404 Mar 2021 pre-releaseRelease notes
Open source →- core: Update dio to 4.0.0-beta4.
- Add missing
copyWithmethod inCacheOptionsto allow single option change. - Small improvements & fixes
Release notes
Open source →-
core: Update dio to 4.0.0-beta4.
-
Add missing copyWith method in CacheOptions to allow single option change.
-
Small improvements & fixes
-
2.0.0-beta.328 Feb 2021 pre-release -
2.0.0-beta.221 Feb 2021 pre-releaseRelease notes
Open source →- fix: Hide FileCacheStore for web support.
- core: Remove flutter dependency.
-
2.0.0-beta.120 Feb 2021 pre-releaseRelease notes
Open source →- Breaking: Moved from sqflite to Moor(:ffi) package for DbCacheStore.
- Breaking: Data stored with DbCacheStore is not compatible with previous versions.
- feat: Open support for linux, macOS, Windows and web platforms.
- core: Updated code to get rid of dart:io package for web platform.
Release notes
Open source →-
Breaking : Moved from sqflite to Moor(:ffi) package for DbCacheStore.
-
Breaking : Data stored with DbCacheStore is not compatible with previous versions.
-
feat: Open support for linux, macOS, Windows and web platforms.
-
core: Updated code to get rid of dart:io package for web platform.
-
1.0.013 Feb 2021Release notes
Open source →- core: Same version as 0.6.0. Updating dependencies.
- core: Add missing analysis pedantic file.
- fix: Remaining minor warnings.
- core: No known issue. Bump to 1.0 to be prepared for null safety version.
-
0.6.029 Nov 2020Release notes
Open source →- feat: Add
Cache-controlheader for response directives (all values are stored). - feat: Add
Dateheader. - feat: Add
Expiresheader (if date is invalid (i.e. 0), date is considered expired to 1970-01-01). - feat: Cached response is now stored with absolute date (also used for max-age calculation).
- feat:
CacheStoreis no more required inCacheOptionsto ease subsequent requests with global options. - feat:
Responseobject has nowCacheResponse.fromCache: trueextra boolean if coming from cache withCacheResponse.cacheKey. - fix:
Responseextra are no more concatenated withRequestOptionsextra (useResponse.request.extrafor this). - fix(wording):
stalledOnlyrenamed tostaleOnlyinCacheStore. - various minor fixes and improvements.
Note:
This version should be backward compatible (data related) with 0.5.x versions (Please report any issues).
Even so, you're advised to clean stores to refresh entries with new headers.With this version, 1.0 should be around the corner.
Release notes
Open source →-
feat: Add Cache-control header for response directives (all values are stored).
-
feat: Add Date header.
-
feat: Add Expires header (if date is invalid (i.e. 0), date is considered expired to 1970-01-01).
-
feat: Cached response is now stored with absolute date (also used for max-age calculation).
-
feat: CacheStore is no more required in CacheOptions to ease subsequent requests with global options.
-
feat: Response object has now CacheResponse.fromCache: true extra boolean if coming from cache with CacheResponse.cacheKey .
-
fix: Response extra are no more concatenated with RequestOptions extra (use Response.request.extra for this).
-
fix(wording): stalledOnly renamed to staleOnly in CacheStore .
-
various minor fixes and improvements.
Note: This version should be backward compatible (data related) with 0.5.x versions (Please report any issues). Even so, you're advised to clean stores to refresh entries with new headers.
With this version, 1.0 should be around the corner.
- feat: Add
-
0.5.112 Oct 2020Release notes
Open source →- fix: ETag conditional requesting with If-None-Match (Thanks @live9080).
- Update README.MD
-
0.5.008 Oct 2020Release notes
Open source →- feat: add backup cache store
- core: add stores testing
- fix: file store associated fixes
-
0.4.023 Sep 2020Release notes
Open source →- Add MemCacheStore. Cache with LRU strategy on RAM.
- Re-add 'exists' store method.
- Multiple fixes on maxStale (purge, get/set)
- Various cleanups.
-
0.3.022 Sep 2020Release notes
Open source →- Add decrypt/encrypt methods to CacheOptions (no encryption by default. Private directories for stores are prefered for common usage).
- Remove 'exists' store method.
-
0.2.022 Sep 2020 -
0.2.0+122 Sep 2020Nothing published for this version
-
0.2.0+222 Sep 2020Nothing published for this version
-
0.2.0+322 Sep 2020Nothing published for this version
-
0.2.0+422 Sep 2020Nothing published for this version
-
0.1.022 Sep 2020Release notes
Open source →- Initial version
- DB cache store
- File cache store
- ETag
- Last-Modified
- Max stale
- CacheOptions
Release notes
Open source →-
Initial version
-
DB cache store
-
File cache store
-
ETag
-
Last-Modified
-
Max stale
-
CacheOptions
438
likes
160
points
214k
downloads
Documentation
API reference
Publisher
cow-level.ovh
Weekly Downloads
Metadata
Dio HTTP cache interceptor with multiple stores respecting HTTP directives (or not).
Repository (GitHub)
View/report issues
License
Apache-2.0 ( license )
Dependencies
dio , http_cache_core
More
Packages that depend on dio_cache_interceptor
← Metadata
438
likes
160
points
214k
downloads
Documentation
API reference
Publisher
cow-level.ovh
Weekly Downloads
Metadata
Dio HTTP cache interceptor with multiple stores respecting HTTP directives (or not).
Repository (GitHub)
View/report issues
License
Apache-2.0 ( license )
Dependencies
dio , http_cache_core
More
Packages that depend on dio_cache_interceptor
Back