Cache

File-system backed cache helper with TTL-based invalidation.

Constructor

new Cache(app)

Parameters:
NameTypeDescription
appobject

Application container.

Members

_purgeItem

Remove a specific cache namespace or all first-level namespaces.

dispose

Dispose internal reference.

getRootDir

Get root cache directory for this plugin.

load

Load cached content when available and not expired.

prep

Prepare cache paths for a namespaced key and TTL.

purge

Purge cache by namespace or remove expired TTL directories.

save

Save a value into cache for the given key and TTL directory.

sync

Return cached content, and store the fallback value if cache is empty.