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

web


web / lib/services/cache/storage/file-system

lib/services/cache/storage/file-system

File system cache storage implementation.

This storage backend persists cache entries to the file system, allowing data to survive process restarts. It organizes cache files in subdirectories for better performance with large numbers of entries and maintains an index for fast lookups.

Classes

FileSystemCacheStorage

Cache storage interface for different backends

Implements

Constructors

Constructor

new FileSystemCacheStorage(options): FileSystemCacheStorage

Parameters
options

FileSystemCacheOptions = {}

Returns

FileSystemCacheStorage

Methods

get()

get<T>(key): Promise<null | CacheEntry<T>>

Get a value from cache

Type Parameters
T

T

Parameters
key

string

Returns

Promise<null | CacheEntry<T>>

Implementation of

CacheStorage.get

set()

set<T>(key, value, options?): Promise<void>

Set a value in cache

Type Parameters
T

T

Parameters
key

string

value

T

options?

CacheSetOptions

Returns

Promise<void>

Implementation of

CacheStorage.set

delete()

delete(key): Promise<boolean>

Delete a value from cache

Parameters
key

string

Returns

Promise<boolean>

Implementation of

CacheStorage.delete

has()

has(key): Promise<boolean>

Check if key exists

Parameters
key

string

Returns

Promise<boolean>

Implementation of

CacheStorage.has

clear()

clear(pattern?): Promise<number>

Clear cache entries matching pattern

Parameters
pattern?

string

Returns

Promise<number>

Number of entries cleared

Implementation of

CacheStorage.clear

keys()

keys(pattern?): Promise<string[]>

Get all keys matching pattern

Parameters
pattern?

string

Returns

Promise<string[]>

Implementation of

CacheStorage.keys

getMany()

getMany<T>(keys): Promise<Map<string, CacheEntry<T>>>

Get multiple values at once

Type Parameters
T

T

Parameters
keys

string[]

Returns

Promise<Map<string, CacheEntry<T>>>

Implementation of

CacheStorage.getMany

setMany()

setMany<T>(entries, options?): Promise<void>

Set multiple values at once

Type Parameters
T

T

Parameters
entries

Map<string, T>

options?

CacheSetOptions

Returns

Promise<void>

Implementation of

CacheStorage.setMany

getStats()

getStats(): Promise<CacheStats>

Get cache statistics

Returns

Promise<CacheStats>

Implementation of

CacheStorage.getStats

cleanup()

cleanup(): Promise<number>

Clean up expired entries

Returns

Promise<number>

Number of entries cleaned

Implementation of

CacheStorage.cleanup

destroy()

destroy(): void

Destroy the storage (cleanup resources)

Returns

void

Implementation of

CacheStorage.destroy

Last updated on