mirror of
https://github.com/arthurfiorette/axios-cache-interceptor.git
synced 2026-02-01 14:32:40 +00:00
docs: improved searched terms
This commit is contained in:
parent
0a7a705df4
commit
0afd079787
@ -64,9 +64,9 @@ The function used to interpret all headers from a request and determine a time t
|
||||
|
||||
::: warning
|
||||
|
||||
Many backends returns `Cache-Control: no-cache` or `Cache-Control: no-store` headers,
|
||||
which results in this library not caching at all. You shall disable `headerInterpreter`
|
||||
for those requests.
|
||||
Many REST backends returns some variation of `Cache-Control: no-cache` or
|
||||
`Cache-Control: no-store` headers, which tell us to ignore caching at all. You shall
|
||||
disable `headerInterpreter` for those requests.
|
||||
|
||||
_If the debug mode prints `Cache header interpreted as 'dont cache'` this is probably the
|
||||
reason._
|
||||
|
||||
@ -99,19 +99,13 @@ The eviction is done by the following algorithm:
|
||||
5. If it still fails, the data is not saved. _Probably because the whole key is greater
|
||||
than the quota or other libraries already consumed the whole usable space._
|
||||
|
||||
## Third Party Storages
|
||||
## buildStorage()
|
||||
|
||||
These are not guaranteed to work with the latest version of the library, neither are
|
||||
maintained by the axios cache interceptor team. But, as we provide a minimal interface for
|
||||
storages, you can use them as a base to also create your own.
|
||||
All integrated storages are wrappers around the `buildStorage` function. External
|
||||
libraries use it and if you want to build your own, `buildStorage` is the way to go!
|
||||
|
||||
- [Node Redis v4](#node-redis-v4-example)
|
||||
- **Have another one?**
|
||||
[Open a PR](https://github.com/arthurfiorette/axios-cache-interceptor/pulls) to add it
|
||||
here.
|
||||
|
||||
The exported `buildStorage` abstracts the storage interface and requires a super simple
|
||||
object to build the storage. It has 3 methods:
|
||||
The exported `buildStorage` function abstracts the storage interface and requires a super
|
||||
simple object to build the storage. It has 3 methods:
|
||||
|
||||
- `set(key: string, value: NotEmptyStorageValue, currentRequest?: CacheRequestConfig): MaybePromise<void>`:
|
||||
Receives the key and the value, and optionally the current request. It should save the
|
||||
@ -124,6 +118,17 @@ object to build the storage. It has 3 methods:
|
||||
Receives the key and optionally the current request. It should return the value from the
|
||||
storage or `undefined` if not found.
|
||||
|
||||
## Third Party Storages
|
||||
|
||||
These are not guaranteed to work with the latest version of the library, neither are
|
||||
maintained by the axios cache interceptor team. But, as we provide a minimal interface for
|
||||
storages, you can use them as a base to also create your own.
|
||||
|
||||
- [Node Redis v4](#node-redis-v4-example)
|
||||
- **Have another one?**
|
||||
[Open a PR](https://github.com/arthurfiorette/axios-cache-interceptor/pulls) to add it
|
||||
here.
|
||||
|
||||
## Node Redis Example
|
||||
|
||||
To inspire you, here is an example for a server-side application that uses Redis as the
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user