11# Introduction
22
3- Axios Cache Interceptor is a , as it name says, a interceptor for axios to handle caching.
3+ Axios Cache Interceptor is an interceptor for axios , as its name says, to handle caching.
44It was created to help developers call axios multiple times without having to worry about
5- overloading the network or coding himself a simple and buggy cache system.
5+ overloading the network or coding themselves a simple and buggy cache system.
66
77Each request goes through an interceptor applied to your axios instance. There, we handle
88each request and decide if we should send it to the network or return a cached response.
@@ -16,9 +16,9 @@ choosing to use interceptors, we create a minimally invasive approach that allow
1616still use the axios adapter of your choice.
1717
1818Before the request is delivered to the adapter, our request interceptor checks if the
19- request have already been cached and if it's a valid one , checks if the request should be
20- cached (sometimes you don't want cache at all, and it 's ok), if there's already a request
21- sent to the network that we can wait for it and many more other checks.
19+ request has already been cached and if it's valid, checks if the request should be
20+ cached (sometimes you don't want cache at all, and that 's ok), if there's already a request
21+ sent to the network that we can wait for, and many other checks.
2222
2323After the adapter gets the response, we check if it belongs to a _ cacheable_ request,
2424saves it into the storage, resolves other requests awaiting for the same resource and
@@ -41,13 +41,13 @@ finally returns the response to the original caller.
4141### axios-cache-adapter
4242
4343The creation of this library is heavily inspired by axios-cache-adapter. It was a great
44- library but now it is unmaintained and has a lot of unresolved issues. Also, it weights
45- more than 4x the size of this library with less features and less performance.
44+ library but now it is unmaintained and has a lot of unresolved issues. Also, it weighs
45+ more than 4x the size of this library with fewer features and less performance.
4646
4747### Fetch and some state management library?
4848
4949As this library was built to be used with axios and to handle storage itself, I can assure
50- that it is more performant that any glued code you may find and/or write yourself. About
50+ that it is more performant than any glued code you may find and/or write yourself. About
5151state management libraries and other similar things,
5252[ this blog post] ( https://arthur.place/implications-of-cache-or-state ) explains why cache
53- is more correct, architectural way, instead of state.
53+ is the more correct, architectural way, instead of state.
0 commit comments