Nuxt/examples/cached-components
Victor Tolbert 2ad9951a71 Fix markdown table and typo 2016-12-05 20:36:08 -05:00
..
pages Add cached-components example 2016-12-01 19:09:40 +01:00
README.md Fix markdown table and typo 2016-12-05 20:36:08 -05:00
nuxt.config.js Add cached-components example 2016-12-01 19:09:40 +01:00
package.json Add cached-components example 2016-12-01 19:09:40 +01:00

README.md

Cached Components

Nuxt.js use lru-cache to allows cached components for better render performances

Usage

Use the cache key in your nuxt.config.js:

module.exports = {
  cache: true
}

cache can be a Boolean or an Object, if an object, you can use theses keys:

key Optional? Type Default definition
max Optional Integer 1000 The maximum size of the cached components, when the 1001 is added, the first one added will be removed from the cache to let space for the new one.
maxAge Optional Integer 900000 Maximum age in ms, default to 15 minutes.

Other options: https://github.com/isaacs/node-lru-cache#options

Demo

npm install
npm start

Go to http://localhost:3000