Skip to content

nuxt-community/component-cache-module

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

Component Cache

npm npm (scoped with tag)

vue-server-renderer has built-in support for 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
{
  modules: [
    // Simple usage
    '@nuxtjs/component-cache',
    
    // With options
    ['@nuxtjs/component-cache', { maxAge: 1000 * 60 * 60 }],
  ]
}

Options

See component-level caching for mor information.

max

  • default: 10000

maxAge

  • default: 1000 * 60 * 15 (15 minutes)