arthurfiorette / axios-cache-interceptor

📬 Small and efficient cache interceptor for axios. Etag, Cache-Control, TTL, HTTP headers and more!
https://axios-cache-interceptor.js.org
MIT License
703 stars 58 forks source link

Feature: clear storage method #848

Closed damen-dd closed 5 months ago

damen-dd commented 5 months ago

Hello! Thank you for this lib, very easy and straightforward.

This small feature provides an interface to remove all cached data. My use case is - I have very complex flow of multiple parallel requests between different workspaces with different axios instances and everything should be cached. And at some point I need to invalidate all cache which I found easier and faster to clear all cache instead of maintaining ids and writing a bunch of update functions.

example which is also in the docs:

if (condition) {
  axios.storage.clear();
}
codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.27%. Comparing base (7089cbc) to head (8901f41). Report is 2 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #848 +/- ## ======================================= Coverage 99.26% 99.27% ======================================= Files 19 19 Lines 2442 2470 +28 Branches 212 216 +4 ======================================= + Hits 2424 2452 +28 Misses 17 17 Partials 1 1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

arthurfiorette commented 5 months ago

thanks!

SrWildman commented 3 months ago

Any timeline on when this feature will be released?

kotokatu commented 2 months ago

Really waiting for it to be released

arthurfiorette commented 2 months ago

done! v1.6.0