CachePlugin(options?: CachePluginOptions): IPlugin
Creates the CachePlugin.
Registers an ICacheStore under CAPABILITIES.CACHE (or
cache.<name> when a custom name is provided for multi-cache setups).
Example 1
Example 1
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 } }));
optional
options: CachePluginOptions
Plugin configuration