Skip to content

Commit

Permalink
docs: improved searched terms
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurfiorette committed Feb 16, 2023
1 parent 0a7a705 commit 0afd079
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
6 changes: 3 additions & 3 deletions docs/src/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -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._
Expand Down
27 changes: 16 additions & 11 deletions docs/src/guide/storages.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

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.
## buildStorage()

- [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.
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!

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
Expand All @@ -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
Expand Down

0 comments on commit 0afd079

Please sign in to comment.