arthurfiorette / axios-cache-interceptor

📬 Small and efficient cache interceptor for axios. Etag, Cache-Control, TTL, HTTP headers and more!

Home Page:https://axios-cache-interceptor.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Is there an option to make a request that will cross out the cashe?

meilechwieder opened this issue · comments

I want the default behavior to be that requests are not cashed, and only when I specify {cahce: true} that it should be cashed.

Also, even a cached call, I want to be able to say on a subsequent call {takeFromCache: false} which should skip checking in cache this reqeust and revalidate just this time. Use case: seeing data is not so important do be the latest version of data, but once user presses "edit", then I want to make another call to make sure that will get the edit-form prefilled with the most up-to-date data, not to accidentally override updates that he doesn't have yet.

are any of the above possible?

For your usecase, the best fit is to use it normally and once the user clics edit, you request with https://axios-cache-interceptor.js.org/config/request-specifics#cache-override, which will make the request anyways, but subsequent calls may benefit from this response.