I have a service worker following this method here, outlined by Nicolas Bevacqua. The code works for me after some small tweaks. But when navigating around for a while the cache gets some serious bloat. I've added some exclusions i.e.
if (( event.request.url.indexOf( '/maps/' ) !== -1 ) ||
( event.request.url.indexOf( '/mapfiles/' ) !== -1 ) ||
( event.request.url.indexOf( '/maps-api-v3/' ) !== -1 ) ||
( event.request.url.indexOf( '/images/' ) !== -1 ) ||
( event.request.url.indexOf( '.mp4' ) !== -1 ) ) {
return false;
}
But what is strange is the cache total size is not reflective of what's in the actual caches. There seems to be data in there that is not listed in my two caches. Is there a way to stop this from happening? And is the service worker caching hidden files?
Hope this helps! Feel free to ask more or update your question!