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.
Options controlling a withTtlCache wrapper.
Default freshness window for a cached response, in ms (chemicalInfo.cacheTtlDays in
config.json).
Calls
fetchwith a timeout. The abort also covers reading the body, so a stalled response can't hang a caller; the rejection is aTimeoutErrorDOMException.