Skip to content

Commit 2434401

Browse files
waydelyleAkryum
authored andcommitted
feat: Added LRU cache options. (#120)
1 parent afcae54 commit 2434401

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

docs/guide/configuration.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ module.exports = {
3838
directives: {
3939
// See 'Directive' chapter
4040
}
41+
lruCacheOptions: {
42+
// See https://ssr.vuejs.org/guide/caching.html
43+
},
4144
}
4245
}
4346
}

lib/app.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,13 @@ module.exports = (app, options) => {
2929

3030
const directives = config.directives
3131

32+
const lruCacheOptions = config.lruCacheOptions || {}
33+
3234
const defaultRendererOptions = {
3335
cache: LRU({
3436
max: 1000,
3537
maxAge: 1000 * 60 * 15,
38+
...lruCacheOptions,
3639
}),
3740
runInNewContext: false,
3841
inject: false,

lib/config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ module.exports = {
1616
templatePath: null,
1717
serviceWorkerPath: null,
1818
directives: {},
19+
lruCacheOptions: {},
1920
}

0 commit comments

Comments
 (0)