background-fetch
background-fetch copied to clipboard
Add garbage collection section
Cover that removing an item from background fetch active fetches doesn't mean the data is removed from disk.
Removing from disk happens when references to those requests/responses, along with the methods to retrieve them, such as BackgroundFetchSettledFetches
, are GC'd.
Thanks for adding this! Nit: once they've been removed, it should be sufficient to keep them in RAM instead of persistently on disk, since if the browser is shutdown then the references will also go away. Of course, as an implementation detail doing so would likely use too much RAM, and so they'll probably have to stay on disk in most cases anyway :)
Yeah, moving them into RAM seems bad for movies and such, unless the bodies are still backed by disk.
I believe we already handle this for the cache API. As in, you can caches.delete(cacheName)
, but if you already have a reference to the cache you can still get the requests and responses.