Skip to Content
⚠️Active Development Notice: TimeTiles is under active development. Information may be placeholder content or not up-to-date.

web


web / lib/services/cache/manager

lib/services/cache/manager

Cache manager for creating and managing cache instances.

This manager provides a factory pattern for creating cache instances with different storage backends and configurations. It manages singleton instances and provides global cache operations.

Enumerations

CacheBackend

Enumeration Members

MEMORY

MEMORY: "memory"

FILESYSTEM

FILESYSTEM: "filesystem"

Classes

CacheManager

Cache manager for creating and managing cache instances

Constructors

Constructor

new CacheManager(): CacheManager

Returns

CacheManager

Methods

getCache()

static getCache(name, backend?, config?): Cache

Create or get a cache instance

Parameters
name

string = "default"

backend?

CacheBackend

config?

Partial<CacheConfig>

Returns

Cache

clearAll()

static clearAll(): Promise<void>

Clear all cache instances

Returns

Promise<void>

getAllStats()

static getAllStats(): Promise<Record<string, CacheStats>>

Get stats for all caches

Returns

Promise<Record<string, CacheStats>>

cleanupAll()

static cleanupAll(): Promise<number>

Cleanup all cache instances

Returns

Promise<number>

destroyAll()

static destroyAll(): Promise<void>

Destroy all cache instances

Returns

Promise<void>

getInstance()

static getInstance(name): undefined | Cache

Get a specific cache instance if it exists

Parameters
name

string

Returns

undefined | Cache

hasInstance()

static hasInstance(name): boolean

Check if a cache instance exists

Parameters
name

string

Returns

boolean

Last updated on