Re: [w3c/ServiceWorker] Allow caches to opt-in to granular cleanup (#863)

> When does Workbox check expiration dates? Our experience has been that IDB latency is not reliably low enough to block time-sensitive operations, like serving requests. We put our expiration dates as a header in the cached response, and check the header when serving, to make sure the asset isn't expired. The IDB latency issue is discussed more in #1331.

Workbox has a freshness sanity check prior to calling `respondWith()` that goes against the `Date` header in the cached `Response` object. We are doing that so as not to block on IndexedDB.

It expires entries based on IndexedDB metadata (maximum entries and/or maximum age) via a separate codepath that runs after `respondWith()` has been called, with a guard in place to prevent simultaneous clean-ups from happening at once.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/issues/863#issuecomment-434409909

Received on Tuesday, 30 October 2018 18:16:56 UTC