Skip to main content

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[]) => ;
}

cacheSize

property

ttlProvider

property
CacheTtlProvider

constructor

method
(config?: { cacheSize?: number; cacheTtlProvider?: CacheTtlProvider }) => SqlCacheStrategy

connection

configService

property
ConfigService

init

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[]) =>