Improve interceptor registration order by letting users decide it. #613
Labels
documentation
Improvements or additions to documentation
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
First of all these are in the reverse order (source).
The request cache interceptor should be the first one to execute and the response interceptor should also be the first one to resolve by default. This way, retry/rate limiter interceptors will only handle requests that would actually go through the network.
Ideal registration order would be like this:
Our current api suggests the use of
setupCache(Axios.create())
, which mostly forces the usage of the following order:which are caused by these lines:
axios-cache-interceptor/src/cache/create.ts
Lines 93 to 94 in b731b2c
My current idea is to do these 3 following ways:
The text was updated successfully, but these errors were encountered: