Skip to content

Bulk delete/edit multiple caches #639

Closed Answered by arthurfiorette
mohaali482 asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @mohaali482, internally, all request URLs are hashed into a unique ID, making it impossible to do such thing like a startsWith comparison, as both URLs will be transformed to completely different numbers.

https://www.npmjs.com/package/object-code

However, you its possible to override your own key generator function to include the original id (only to keep uniqueness) + path (or something that you would use to group requests).

https://axios-cache-interceptor.js.org/guide/request-id#custom-generator

Something like this:

const axios = setupCache(Axios, {
  keyGenerator: buildKeyGenerator((request) => {
     // Would return something like -2389472895my-group-identifier
     return default…

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@mohaali482
Comment options

@arthurfiorette
Comment options

@mohaali482
Comment options

@arthurfiorette
Comment options

@mohaali482
Comment options

Answer selected by mohaali482
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants