我正在使用工作箱运行时缓存来缓存外部调用(materialize.css 就是其中之一)。在我的网络选项卡中,它显示请求来自 serviceWorker(看起来不错):
但是在缓存存储上,我的运行时缓存看起来是空的:
您可以在 chrome 的应用程序选项卡上看到我的服务人员,这是网站:https ://quack.surge.sh/
服务工作者代码:
const workboxSW = new self.WorkboxSW();
workboxSW.precache(fileManifest);
workboxSW.router.registerNavigationRoute("/index.html");workboxSW.router.registerRoute(/^https:\/\/res.cloudinary.com\/dc3dnmmpx\/image\/upload\/.*/, workboxSW.strategies.cacheFirst({}), 'GET');
workboxSW.router.registerRoute('https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/css/materialize.min.css', workboxSW.strategies.cacheFirst({}), 'GET');
workboxSW.router.registerRoute('https://res.cloudinary.com/dc3dnmmpx/image/upload/(.*)', workboxSW.strategies.cacheFirst({}), 'GET');
这是预期的行为吗?我对服务人员很陌生,我不确定正确的结果是什么。