A Nuxt.js module for server-side page and API response caching using Redis. Current stable version is 1.1.4. It provides easy-to-configure Redis-backed caching of full rendered pages and API requests with per-route expiration. Key differentiators: simple module-based setup, injects $cacheFetch, $cacheRead, $cacheWrite methods, supports separate Redis server per route, and can ignore connection errors for resilience. Works with Nuxt 2 (SSR).
npm install nuxt-perfect-cacheNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Configures redis caching for the homepage and demonstrates API response caching with $cacheFetch.
Set disable: false in module options or set NUXT_PERFECT_CACHE_DISABLED=0 in .env
Ensure getCacheData returns false for routes with personalized data
Use a private Redis server or avoid password in url; the url is injected into client bundle
Upgrade to >=1.0.4 to use this option
Open a route that is not cached (getCacheData returns false) until build process completes
Ensure getCacheData function is defined in the module options array
Use $cacheFetch only inside asyncData, fetch, or serverMiddleware; ensure module is correctly loaded