Registry / web-framework / nuxt-ssr-cache

nuxt-ssr-cache

JSON →
library1.5.2jsnpmunverified

nuxt-ssr-cache v1.5.2 is a cache middleware for Nuxt.js server-side rendering. It supports multiple cache stores: in-memory, Redis, Memcached, and layered multi-cache. The package allows prefixing cache keys by host, custom key functions, and version-based automatic cache purging on deployment. It is designed for Nuxt.js applications needing to reduce SSR load by caching rendered pages. The library has been stable since its last release but is not frequently updated. It relies on the Nuxt module system and optional peer dependencies for Redis and Memcached stores.

npm install nuxt-ssr-cache
INSTALL
IMPORT
SIG · NUXT-SSR-CACHE
N
nuxt-ssr-cache
web-frameworkjavascriptv1.5.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
// Add to modules in nuxt.config.js: 'nuxt-ssr-cache'
import nuxtSsrCache from 'nuxt-ssr-cache' // Not a direct import; used as Nuxt module
This package is a Nuxt module; it must be added to the modules array in nuxt.config.js, not imported directly in component code.

Configure nuxt-ssr-cache as a Nuxt module with in-memory cache for root and about pages, 60-second TTL.

// nuxt.config.js module.exports = { version: '1.0.0', modules: ['nuxt-ssr-cache'], cache: { useHostPrefix: false, pages: ['/', '/about'], store: { type: 'memory', max: 100, ttl: 60 } } }
Debug
Known issues
gotchaThe `key` option function, when provided, overrides both `useHostPrefix` and `pages`. Those properties are ignored.
fix
If you need to use `useHostPrefix` or `pages`, do not define the `key` function.
affects: >=1.0.0
gotchaFor multi-store (layered) cache, the `stores` array must contain configuration objects; using `type: 'multi'` alone without `stores` will cause an error.
fix
Ensure `stores` array is provided with at least one store configuration.
affects: >=1.0.0
deprecatedThe package relies on `cache-manager-redis` and `cache-manager-memcached-store`, which are older libraries and may not be actively maintained.
fix
Consider using newer Redis/Memcached cache stores or evaluate alternative cache modules for Nuxt.
affects: >=1.0.0
breakingIn version 1.2.0, the `cache` config structure changed: `store` now expects an object with `type` instead of a string. Old configs with `store: 'memory'` will break.
fix
Update store configuration to object form: `store: { type: 'memory', ... }`.
affects: >=1.2.0
Errors
Common errors & fixes
Error: Cannot find module 'cache-manager-redis'
Missing optional dependency for Redis store.
fix
Install the Redis store package: `npm install cache-manager-redis`
Error: The cache store configuration is invalid. Expected an object with a 'type' property.
Using old string-based store configuration (e.g., `store: 'memory'`) after version 1.2.0.
fix
Change to object format: `store: { type: 'memory', max: 100, ttl: 60 }`
Error: Invalid pages configuration. Pages must be an array of strings or RegExp.
Passing a non-array or invalid element in the `pages` option.
fix
Ensure `pages` is an array of strings (path prefixes) or RegExp objects.
Upgrade
Version history
1.5.2latest on npm
Audit
Dependencies
cache-manager-redisoptionalRequired only when using the Redis store type.
cache-manager-memcached-storeoptionalRequired only when using the Memcached store type.
Agent activity
6 hits · last 30 days
node
6
Resources
nuxt-ssr-cache — npm install nuxt-ssr-cache · libregistry