Skip to content

Commit a71a279

Browse files
committed
simplify lru-cache example
1 parent c908e6f commit a71a279

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/guide/ssr.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -287,16 +287,11 @@ var createRenderer = require('vue-server-renderer').createRenderer
287287
var lru = require('lru-cache')
288288

289289
var renderer = createRenderer({
290-
cache: lru({
291-
max: 10000000,
292-
length: function (n, key) {
293-
return n.length
294-
}
295-
})
290+
cache: lru(1000)
296291
})
297292
```
298293

299-
That will cache up to 10 million characters of HTML (10MB assuming 1 byte per character). See [the lru-cache options](https://github.com/isaacs/node-lru-cache#options) for other configurations.
294+
That will cache up to 1000 unique renders. For other configurations that more closely align to memory usage, see [the lru-cache options](https://github.com/isaacs/node-lru-cache#options).
300295

301296
Then for components you want to cache, you must provide them with:
302297

0 commit comments

Comments
 (0)