axios-extensions
axios-extensions copied to clipboard
Invalidate cache when PUT/PATCH/DELETE requests are made to same URL
Suppose you cache a GET request to /foo/123.
Can the adapter be smart enough to invalidate this cache entry when it detects a PUT/PATCH/DELETE request to the same URL?
A similar feature exists in axios-cache-adapter and would be useful to have so we don't have to write it ourselves outside of the adapter.
Totally agree, we write this in to our own logic, but it makes sense that if an update is made it clears the cache entry
It would be great if this feature will be implemented
Totally agree, we write this in to our own logic, but it makes sense that if an update is made it clears the cache entry
can you share your realization pls?
+1 for this feature. Could be also a configuration of cache adapter to behave like this.
Also, I believe cache of GET to /foo must be invalidated along with cache for /foo/123 in case of PUT/PATCH/DELETE request to /foo/123. In most cases GET /foo returns list of items and if some of such items updated — better to invalidate cache for list also.