[英]When caching files via service worker the cache gets very bloated, is service worker caching hidden files?
I have a service worker following this method here , outlined by Nicolas Bevacqua.我有一个服务人员在这里遵循 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 ie
我添加了一些排除项,即
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?
Service Worker 是否在缓存隐藏文件?
Hope this helps!希望这可以帮助! Feel free to ask more or update your question!
随时提出更多问题或更新您的问题!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.