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.
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 invokesfnon 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 tofn, so the wrapper can never break a caller that runs withoutchrome.storage.