google-chrome - 来自 Service Worker 缓存的资源的巨大内容下载时间

标签 google-chrome service-worker progressive-web-apps

我正在拦截并从 Service Worker 缓存中返回一个资源。根据 Google Chrome devtools 下载内容大约需要 300-400 毫秒。我检查了 Firefox,下载是即时​​的。

Huge content download time

由于不涉及网络,我预计下载时间会小得多。我用通常的 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/

相关文章:

html - 绝对位置和 css3 的 Chrome 渲染错误

javascript - 即使我将 script 标签放在 body 标签末尾之前,Google Chrome 也会首先加载 javascript

javascript - 每个源服务工作线程可以在浏览器缓存中存储多少数据?

Angular 7 - 服务 worker 未注册

cordova - 有没有办法在Google Play上提交reactjs PWA?

java - Applet 在 Google Chrome 上挂起

javascript - 是否可以检测到 chrome 应用程序内部?

javascript - 使用工作箱从服务 worker 文件中读取环境变量

node.js - 我可以使用 MongoDB 模式模型来定义 IndexedDB 索引吗?

ios - iOS 12.2 是否支持 PWA 的 GPS?