SqlCacheStrategy
SqlCacheStrategy
A CacheStrategy that stores cached items in the database. This is the strategy used by the DefaultCachePlugin.
Signature
class SqlCacheStrategy implements CacheStrategy {
protected cacheSize = 10_000;
protected ttlProvider: CacheTtlProvider;
constructor(config?: { cacheSize?: number; cacheTtlProvider?: CacheTtlProvider })
protected connection: TransactionalConnection;
protected configService: ConfigService;
init(injector: Injector) => ;
get(key: string) => Promise<T | undefined>;
set(key: string, value: T, options?: SetCacheKeyOptions) => ;
delete(key: string) => ;
invalidateTags(tags: string[]) => ;
}
- Implements:
CacheStrategy
cacheSize
property
ttlProvider
property
CacheTtlProviderconstructor
method
(config?: { cacheSize?: number; cacheTtlProvider?: CacheTtlProvider }) => SqlCacheStrategyconnection
property
configService
property
ConfigServiceinit
method
(injector: Injector) => get
method
(key: string) => Promise<T | undefined>set
method
(key: string, value: T, options?: SetCacheKeyOptions) => delete
method
(key: string) => invalidateTags
method
(tags: string[]) =>