Skip to content

Commit 7697523

Browse files
committed
chore: update doc
1 parent 703c305 commit 7697523

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

docs/content/docs/cache_drivers.md

+10-3
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,10 @@ import { fileDriver } from "bentocache/drivers/file";
6565
const bento = new BentoCache({
6666
default: 'file',
6767
stores: {
68-
redis: bentostore().useL2Layer(fileDriver({
69-
directory: './cache'
68+
redis: bentostore().useL2Layer(
69+
fileDriver({
70+
directory: './cache',
71+
pruneInterval: '1h'
7072
}))
7173
}
7274
})
@@ -75,6 +77,11 @@ const bento = new BentoCache({
7577
| Option | Description | Default |
7678
| --- | --- | --- |
7779
| `directory` | The directory where the cache files will be stored. | N/A |
80+
| `pruneInterval` | The interval in milliseconds to prune expired entries. false to disable. | false |
81+
82+
### Prune Interval
83+
84+
Since the filesystem driver does not have a way to automatically prune expired entries, you can set a `pruneInterval` to automatically prune expired entries. By setting this option, the driver will launch a [worker thread](https://nodejs.org/api/worker_threads.html) that will clean up the cache at the specified interval.
7885

7986
## Memory
8087

@@ -165,7 +172,7 @@ All SQL drivers accept the following options:
165172
| `tableName` | The name of the table that will be used to store the cache. | `bentocache` |
166173
| `autoCreateTable` | If the cache table should be automatically created if it does not exist. | `true` |
167174
| `connection` | An instance of `knex` or `Kysely` based on the driver. | N/A |
168-
| `pruneInterval` | The interval in milliseconds to prune expired entries. | `60000` |
175+
| `pruneInterval` | The [Duration](./options.md#ttl-formats) in milliseconds to prune expired entries. | false |
169176

170177
### Knex
171178

0 commit comments

Comments
 (0)