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

Add an internal `config.aciResolved` when the adapter is changed to resolve to a cached response.

arthurfiorette opened this issue · comments

When creating custom request interceptors, we could provide a internal aciResolved property on config to warn them that the response was intercepted and its config adapter is just a Promise.resolve().

This is useful for implementations like a rate limiter, because we should not rate limit cached requests.

Line where the property should be added:

config.adapter = (): Promise<CacheAxiosResponse> =>

Also, a test and documentation should be added/changed where needed (I can help with this) .

This was only a common hallucination between me and a friend. response.cached === true already does that.