Overview
The @kimyvgy/nuxt-page-cache is a Node Package Manager (NPM) module that provides page-level caching functionality for Nuxt.js, particularly for multi-store setups. It is built upon the arash16/nuxt-ssr-cache module and includes additional features. The module supports multiple stores including Memory, Redis, Memcached, IORedis, and Multi-cache layered setups.
Features
- Supported Stores: The module supports various cache stores including Memory, Redis, Memcached, IORedis, and Multi-cache layered setups.
- Page Cache Options: Users can choose from different cache stores provided by the module, such as Redis, Memcached, IORedis, and Multi-cache layered options.
- Version Property: The module allows users to define a version property in the root-level
nuxt.config.jsor inside module options. This version property must have a unique value for each release to ensure that cached pages are purged after deploying to production.
Installation
To install the @kimyvgy/nuxt-page-cache module, you can use either NPM or Yarn.
- Using NPM:
npm install @kimyvgy/nuxt-page-cache
- Using Yarn:
yarn add @kimyvgy/nuxt-page-cache
Setup
To activate the module, add the following code in your nuxt.config.js file:
// nuxt.config.js
{
modules: [
'@kimyvgy/nuxt-page-cache'
],
}
Alternatively, you can provide the cache property in the nuxt.config.js file:
// nuxt.config.js
{
cache: {
/* Cache options here */
},
}
Summary
The @kimyvgy/nuxt-page-cache module is a powerful package for enabling page-level caching in Nuxt.js applications, especially for multi-store setups. It supports various cache stores such as Memory, Redis, Memcached, IORedis, and Multi-cache layered options. Additionally, it provides the ability to define a version property to ensure cached pages are purged after each deployment in the production environment.Overall, this module is a useful tool for optimizing the performance and speed of Nuxt.js applications.