Creates the CachePlugin.
Registers an ICacheStore under CAPABILITIES.CACHE (or
cache.<name> when a custom name is provided for multi-cache setups).
Optionaloptions: CachePluginOptions
Plugin configuration
The plugin instance
import { CachePlugin } from '@setu-ts/cache-plugin';
// Memory store (default)
app.register(CachePlugin());
// Redis store with URL
app.register(CachePlugin({
store: 'redis',
options: { url: 'redis://localhost:6379', prefix: 'myapp:' },
}));
// Named cache instance
app.register(CachePlugin({ name: 'session', options: { maxSize: 500 } }));
CachePlugin factory — registers an
ICacheStoreunderCAPABILITIES.CACHE.