Skip to content

Commit

Permalink
docs: added more keywords to help with searching
Browse files Browse the repository at this point in the history
  • Loading branch information
arthurfiorette committed Sep 3, 2023
1 parent ddacace commit b352f12
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
5 changes: 3 additions & 2 deletions docs/src/config.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Global
# setupCache()

These are properties that are used and shared by the entire application.
The `setupCache` function receives the axios instance and a set of optional properties
described below. They are used and shared by the entire application workflow.

```ts
const axios = setupCache(axios, OPTIONS);
Expand Down
3 changes: 2 additions & 1 deletion docs/src/config/request-specifics.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ exceptions to the method rule.
_(These default status codes follows RFC 7231)_

An object or function that will be tested against the response to indicate if it can be
cached.
cached. You can use `statusCheck`, `containsHeader` and `responseMatch` to test against
the response.

```ts{5,8,13}
axios.get<{ auth: { status: string } }>('url', {
Expand Down
2 changes: 1 addition & 1 deletion docs/src/guide/request-id.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ any possible differences between them and share the same cache for both.
If the default generator is not enough for your use case, you can provide your own custom
generator with the `generateKey` option.

By default, it extracts `method`, `baseURL`, `params`, `data` and `url` properties from
By default, it extracts `method`, `baseURL`, `query`, `params`, `data` and `url` properties from
the request object and hashes it into a number with
[`object-code`](https://www.npmjs.com/package/object-code).

Expand Down
13 changes: 13 additions & 0 deletions docs/src/guide/storages.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,19 @@ setupCache(axios, {
});
```

Options:

- **cloneData**: Use `true` if the data returned by `find()` should be cloned to avoid
mutating the original data outside the `set()` method. Use `'double'` to also clone
before saving value in storage using `set()`. Disabled is default

- **cleanupInterval**: The interval in milliseconds to run a setInterval job of cleaning
old entries. If false, the job will not be created. Disabled is default

- **maxEntries**: The maximum number of entries to keep in the storage. Its hard to
determine the size of the entries, so a smart FIFO order is used to determine eviction.
If false, no check will be done and you may grow up memory usage. Disabled is default

## Web Storage API

If you need persistent caching between page refreshes, you can use the `buildWebStorage`
Expand Down

0 comments on commit b352f12

Please sign in to comment.