Skip to main content

DefaultCachePlugin

This plugin provides a simple SQL-based cache strategy SqlCacheStrategy which stores cached items in the database.

It is suitable for production use (including multi-instance setups). For increased performance you can also consider using the RedisCachePlugin.

Signature

options

init

method(options: DefaultCachePluginInitOptions) =>

Configuration options for the DefaultCachePlugin.

Signature

cacheSize

propertynumber
Default:10_000

The maximum number of items to store in the cache. Once the cache reaches this size, the least-recently-used items will be evicted to make room for new items.

cacheTtlProvider

propertyCacheTtlProvider

Optionally provide a custom CacheTtlProvider to control the TTL of cache items. This is useful for testing.

Was this chapter helpful?
Report Issue
Edited Feb 25, 2026ยทEdit this page