gtfs-sqljs
    Preparing search index...

    Interface CacheStore

    Interface for implementing custom cache storage backends.

    The library provides two implementations:

    • IndexedDBCacheStore (for browsers)
    • FileSystemCacheStore (for Node.js)

    You can implement this interface to use custom storage backends (e.g., Redis, S3, or any other storage system).

    interface CacheStore {
        clear(): Promise<void>;
        delete(key: string): Promise<void>;
        get(key: string): Promise<CacheEntryWithData | null>;
        has(key: string): Promise<boolean>;
        list?(): Promise<CacheEntry[]>;
        set(key: string, data: ArrayBuffer, metadata: CacheMetadata): Promise<void>;
    }
    Index

    Methods

    • Clear all cache entries

      Returns Promise<void>

    • Delete a specific cache entry

      Parameters

      • key: string

        Cache key

      Returns Promise<void>

    • Retrieve a cached database by key

      Parameters

      • key: string

        Cache key (typically includes checksum and version)

      Returns Promise<CacheEntryWithData | null>

      The cached entry with data and metadata, or null if not found

    • Check if a cache entry exists

      Parameters

      • key: string

        Cache key

      Returns Promise<boolean>

      true if the cache entry exists

    • Store a database in the cache

      Parameters

      • key: string

        Cache key

      • data: ArrayBuffer

        Database as ArrayBuffer

      • metadata: CacheMetadata

        Metadata about the cached database

      Returns Promise<void>