我正在拦截并从 Service Worker 缓存中返回一个资源。根据 Google Chrome devtools 下载内容大约需要 300-400 毫秒。我检查了 Firefox,下载是即时的。
由于不涉及网络,我预计下载时间会小得多。我用通常的 match
拦截了 fetch功能:
event.respondWith(
caches.match(event.request).then(response => response)
);
我在拦截和从缓存中返回资源的方式上有什么问题吗?
最佳答案
您可以从这个 google forum 尝试以下解决方案:
- Delete your cache and cookies
- Use incognito mode If this helps then temporarily disable your extensions to identify which one is causing the rendering problem. To do this go to chrome://extensions and uncheck Enabled for each extension one by one.
- Reset your browser settings
- Turn off hardware acceleration by going to Menu > Settings > Advanced Settings > Under 'System' uncheck Use hardware acceleration when available.
关于google-chrome - 来自 Service Worker 缓存的资源的巨大内容下载时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50086666/