Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nuxt-community/component-cache-module
https://github.com/nuxt-community/component-cache-module
Last synced: 13 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/nuxt-community/component-cache-module
- Owner: nuxt-community
- Created: 2020-12-29T09:58:45.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-12-16T05:15:51.000Z (11 months ago)
- Last Synced: 2024-08-02T01:21:37.896Z (3 months ago)
- Language: JavaScript
- Size: 8.79 KB
- Stars: 30
- Watchers: 3
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Component Cache
[![npm](https://img.shields.io/npm/dt/@nuxtjs/component-cache.svg?style=flat-square)](https://www.npmjs.com/package/@nuxtjs/component-cache)
[![npm (scoped with tag)](https://img.shields.io/npm/v/@nuxtjs/component-cache/latest.svg?style=flat-square)](https://www.npmjs.com/package/@nuxtjs/component-cache)> vue-server-renderer has built-in support for [component-level caching](http://ssr.vuejs.org/en/caching.html#component-level-caching).
> This module automatically adds a LRU cache to project.## Setup
- Add `@nuxtjs/component-cache` dependency using yarn or npm to your project
- Add `@nuxtjs/component-cache` to `modules` section of `nuxt.config.js`
```js
{
modules: [
// Simple usage
'@nuxtjs/component-cache',
// With options
['@nuxtjs/component-cache', { maxAge: 1000 * 60 * 60 }],
]
}
```## Options
See [component-level caching](https://v2.ssr.vuejs.org/guide/caching.html#component-level-caching) for mor information.### `max`
- default: `10000`### `maxAge`
- default: `1000 * 60 * 15` (15 minutes)