Skip to content

Commit 49213f3

Browse files
committed
update ssr docs on cache
1 parent ba3bec8 commit 49213f3

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

packages/vue-server-renderer/README.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,27 @@ As an example, check out [`v-show`'s server-side implementation](https://github.
147147

148148
### cache
149149

150-
Specify cache options. Passed directly to [lru-cache](https://github.com/isaacs/node-lru-cache). The default is `{ max: 5000 }`.
150+
> Note: this option has changed and is different from versions < 2.0.0-alpha.8.
151+
152+
Provide a cache implementation. The cache object must be of the following shape:
151153

152154
``` js
155+
{
156+
get: (key: string) => string,
157+
set: (key: string, val: string) => void,
158+
has?: (key: string) => boolean // optional
159+
}
160+
```
161+
162+
A typical usage is passing in an [lru-cache](https://github.com/isaacs/node-lru-cache):
163+
164+
``` js
165+
const LRU = require('lru-cache')
166+
153167
const renderer = createRenderer({
154-
cache: {
168+
cache: LRU({
155169
max: 10000
156-
}
170+
})
157171
})
158172
```
159173

0 commit comments

Comments
 (0)