PackageTrack
Sign in Get early access

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 2026
2021 2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 56
  1. 4.0.7 26 Jun 2026
    Release notes
    • 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
    Open source →
  2. 4.0.6 20 Mar 2026
    Release notes
    • fix: Age header refresh on 304 revalidation
    • chore: Min SDK is now 3.6.0.
    Open source →
  3. 4.0.5 03 Oct 2025
    Release notes
    • chore: Updated dependencies.
    Open source →
  4. 4.0.4 30 Sep 2025
    Release notes
    • fix: Allow keyBuilder to depend on request body.
    Open source →
  5. 4.0.3 02 Apr 2025
    Release notes

    core: 1.1.1 / http_client: 1.0.2

    Open source →
    Release notes
    • fix: BaseRequest now has headers getter instead of headerValuesAsList.
    • chore: Updated dependencies.
    Open source →
    Release notes
    • fix: BaseRequest now has headers getter instead of headerValuesAsList .

    • chore: Updated dependencies.

    Open source →
  6. 4.0.2 29 Mar 2025
    Release notes

    fixes #174

    Open source →
    Release notes
    • fix: Missing exports to handle client only caching.
    Open source →
  7. 4.0.1 28 Mar 2025
    Release notes

    feat: Improve performance on cache check when using cipher.

    Open source →
    Release notes
    • fix: Improve cache save time.
    • fix: CacheOptions#maxStale usage may lead to empty response body.
    • feat: Improve performance on cache check when using cipher.
    Open source →
    Release notes
    • fix: Improve cache save time.

    • fix: CacheOptions#maxStale usage may lead to empty response body.

    • feat: Improve performance on cache check when using cipher.

    Open source →
  8. 4.0.0 27 Mar 2025
    Release notes

    feat: Add http client along dio interceptor.

    Open source →
    Release notes
    • 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.
    Open source →
    Release notes
    • 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.

    Open source →
  9. 3.5.1 08 Dec 2024
    Release notes
    • fix: Allow " in header values.
    • chore: Some more tests added.
    • chore: Updated README.md.
    Open source →
    Release notes
    • fix: Allow " in header values.

    • chore: Some more tests added.

    • chore: Updated README.md.

    Open source →
  10. 3.5.0 27 Nov 2023
    Release notes
    • chore: Updated dependencies.
    • chore: Updated example.
    • feat: Isar added as store.
    • feat: Status 304 is now managed when set as valid status.
    Open source →
  11. 3.4.4 29 Sep 2023
    Release notes

    chore: Allow UUID package version v4.x

    Open source →
    Release notes
    • chore: Allow UUID package version v4.x
    Open source →
  12. 3.4.3 25 Sep 2023
    Release notes

    chore: Now requires Dio >= 5.2.0+1.

    Open source →
    Release notes
    • fix: Correctly serialize null content responses.
    • chore: explicitly allow dart 3.
    • chore: Now requires Dio >= 5.2.0+1.
    Open source →
  13. 3.4.2 06 Apr 2023
    Release notes

    fix: cache headers, trigger improvements

    Open source →
    Release notes
    • 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.
    Open source →
    Release notes
    • 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.

    Open source →
  14. 3.4.1 28 Mar 2023
    Release notes
    • 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').
    Open source →
  15. 3.4.0 22 Feb 2023
    Release notes
    • chore: Allow dio version 5 aside version 4.
    Open source →
  16. 3.3.1 01 Sep 2022
    Release notes
    • fix: pathExists queryParams are not checked correctly (thanks to @clragon)
    Open source →
  17. 3.3.0 08 Jul 2022
    Release notes
    • 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.
    Open source →
    Release notes
    • 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.

    Open source →
  18. 3.2.7 25 Apr 2022
    Release notes
    • 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.
    Open source →
    Release notes
    • 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.

    Open source →
  19. 3.2.6 25 Feb 2022
    Release notes
    • feat: Don't skip subsequent onResponse interceptors if any.
    Open source →
    Release notes
    • feat: Don't skip subsequent onResponse interceptors if any.
    Open source →
  20. 3.2.5 18 Feb 2022
    Release notes
    • fix: Cache control parsing on request. Dio request headers are not of type Headers.
    Open source →
    Release notes
    • fix: Cache control parsing on request. Dio request headers are not of type Headers .
    Open source →
  21. 3.2.4 16 Feb 2022
    Release notes
    • fix: Missing Nullable export.
    Open source →
    Release notes
    • fix: Missing Nullable export.
    Open source →
  22. 3.2.3 15 Feb 2022
    Release notes
    • 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.
    Open source →
    Release notes
    • 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 .

    Open source →
  23. 3.2.2 07 Jan 2022
    Release notes
    • 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.
    Open source →
    Release notes
    • 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.
    Open source →
  24. 3.2.1 07 Jan 2022
    Release notes
    • fix: io import in CacheResponse preventing usage with web platform.
    Open source →
  25. 3.2.0 07 Jan 2022
    Release notes

    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.
    Open source →
    Release notes

    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.

    Open source →
  26. 3.1.0 27 Dec 2021
    Release notes
    • Breaking: File cache store is now available as external package and suitable for production.
    • Improved example with added non-cached content & image provider sample.
    Open source →
    Release notes
    • Breaking : File cache store is now available as external package and suitable for production.

    • Improved example with added non-cached content & image provider sample.

    Open source →
  27. 3.0.3 22 Nov 2021
    Release notes
    • fix: Cipher file export.
    • feat: Add ObjectBox store (All credits go to cmengler).
    Open source →
    Release notes
    • fix: Cipher file export.

    • feat: Add ObjectBox store (All credits go to cmengler ).

    Open source →
  28. 3.0.2 01 Oct 2021
    Release notes
    • fix: Ciphered content deserialization error when updating headers.
    Open source →
  29. 3.0.1 01 Jul 2021
    Release notes
    • fix: file_cache_store visibility.
    Open source →
  30. 3.0.0 22 Jun 2021
    Release notes
    • core: Moved DB & Hive cache stores to their respective packages.
    • fix: import of file_cache_store.
    Open source →
  31. 2.3.1 07 May 2021
    Release notes
    • fix: Cache-Control parsing. Dio does not expand multi valued headers.
    Open source →
  32. 2.3.0 03 May 2021
    Release notes
    • feat: allowPostMethod added to CacheOptions.
    Open source →
    Release notes
    • feat: allowPostMethod added to CacheOptions .
    Open source →
  33. 2.2.0 20 Apr 2021
    Release notes
    • feat: Cache-Control: max-age as cache trigger added.
    • core: update README.md.
    Open source →
  34. 2.1.1 16 Apr 2021
    Release notes
    • fix: refreshForceCache policy added. Get parity with refresh/request and refreshForceCache/forceCache.
    Open source →
  35. 2.1.0 15 Apr 2021
    Release notes
    • feat: Add Hive as cache store.
    Open source →
  36. 2.0.0 29 Mar 2021
    Release notes
    • core: Update dio to 4.0.0.
    • Renamed cacheStoreForce to forceCache.
    • Renamed cacheStoreNo to noCache.
    • Make CacheOptions.store required but still with optional value.
    Open source →
    Release notes
    • core: Update dio to 4.0.0.

    • Renamed cacheStoreForce to forceCache .

    • Renamed cacheStoreNo to noCache .

    • Make CacheOptions.store required but still with optional value.

    Open source →
  37. 2.0.0-rc.1 18 Mar 2021 pre-release
    Release notes
    • 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.
    Open source →
  38. 2.0.0-beta.7 09 Mar 2021 pre-release
    Release notes
    • 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
    Open source →
    Release notes
    • 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

    Open source →
  39. 2.0.0-beta.6 07 Mar 2021 pre-release
    Release notes
    • 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!
    Open source →
    Release notes
    • 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!

    Open source →
  40. 2.0.0-beta.5 05 Mar 2021 pre-release
    Release notes
    • core: Update dio to 4.0.0-beta5.
    • Wrap decrypt/encrypt functions to CacheCipher.
    • Add decent test coverage (still WIP).
    Open source →
    Release notes
    • core: Update dio to 4.0.0-beta5.

    • Wrap decrypt/encrypt functions to CacheCipher .

    • Add decent test coverage (still WIP).

    Open source →
  41. 2.0.0-beta.4 04 Mar 2021 pre-release
    Release notes
    • core: Update dio to 4.0.0-beta4.
    • Add missing copyWith method in CacheOptions to allow single option change.
    • Small improvements & fixes
    Open source →
    Release notes
    • core: Update dio to 4.0.0-beta4.

    • Add missing copyWith method in CacheOptions to allow single option change.

    • Small improvements & fixes

    Open source →
  42. 2.0.0-beta.3 28 Feb 2021 pre-release
    Release notes
    • core: Support null safety
    Open source →
  43. 2.0.0-beta.2 21 Feb 2021 pre-release
    Release notes
    • fix: Hide FileCacheStore for web support.
    • core: Remove flutter dependency.
    Open source →
  44. 2.0.0-beta.1 20 Feb 2021 pre-release
    Release notes
    • 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.
    Open source →
    Release notes
    • 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.

    Open source →
  45. 1.0.0 13 Feb 2021
    Release notes
    • 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.
    Open source →
  46. 0.6.0 29 Nov 2020
    Release notes
    • 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.

    Open source →
    Release notes
    • 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.

    Open source →
  47. 0.5.1 12 Oct 2020
    Release notes
    • fix: ETag conditional requesting with If-None-Match (Thanks @live9080).
    • Update README.MD
    Open source →
  48. 0.5.0 08 Oct 2020
    Release notes
    • feat: add backup cache store
    • core: add stores testing
    • fix: file store associated fixes
    Open source →
  49. 0.4.0 23 Sep 2020
    Release notes
    • Add MemCacheStore. Cache with LRU strategy on RAM.
    • Re-add 'exists' store method.
    • Multiple fixes on maxStale (purge, get/set)
    • Various cleanups.
    Open source →
  50. 0.3.0 22 Sep 2020
    Release notes
    • Add decrypt/encrypt methods to CacheOptions (no encryption by default. Private directories for stores are prefered for common usage).
    • Remove 'exists' store method.
    Open source →
  51. 0.2.0 22 Sep 2020
    Release notes
    • Cancelled.
    Open source →
  52. 0.2.0+1 22 Sep 2020

    Nothing published for this version

  53. 0.2.0+2 22 Sep 2020

    Nothing published for this version

  54. 0.2.0+3 22 Sep 2020

    Nothing published for this version

  55. 0.2.0+4 22 Sep 2020

    Nothing published for this version

  56. 0.1.0 22 Sep 2020
    Release notes
    • Initial version
    • DB cache store
    • File cache store
    • ETag
    • Last-Modified
    • Max stale
    • CacheOptions
    Open source →
    Release notes
    • 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

    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive