ChemPal Documentation - v1.6.0
    Preparing search index...

    Module helpers/requestCache

    Functions - Helpers

    withTtlCache

    Wraps an async function with a persistent, time-to-live cache backed by chrome.storage.local. The returned function checks the cache first and only invokes fn on a miss or when the cached entry has expired. Only defined results are cached, so a failed or empty lookup (undefined) is never negatively cached. Any storage error is swallowed and the call falls through to fn, so the wrapper can never break a caller that runs without chrome.storage.

    Interfaces - Helpers

    TtlCacheOptions

    Options controlling a withTtlCache wrapper.

    Variables - Helpers

    THREE_DAYS_MS

    Three days in milliseconds — the default freshness window for a cached response.