From ddbffcc8af4393e14cc44daa94b4a27a21c6fadf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Chopin?= Date: Thu, 1 Dec 2016 19:09:31 +0100 Subject: [PATCH] Add README --- examples/cached-components/README.md | 30 ++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 examples/cached-components/README.md diff --git a/examples/cached-components/README.md b/examples/cached-components/README.md new file mode 100644 index 0000000000..b42aa3790d --- /dev/null +++ b/examples/cached-components/README.md @@ -0,0 +1,30 @@ +# Cached Components + +> Nuxt.js use [lru-cache](https://github.com/isaacs/node-lru-cache) to allows cached components for better render performances + +## Usage + +Use the `cache` key in your `nuxt.config.js`: +```js +module.exports = { + cache: true +} +``` + +`cache` can be a Boolean of 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 + +```bash +npm install +npm start +``` + +Go to [http://localhost:3000](http://localhost:3000)