Service Worker slow response times for css

蹲街弑〆低调 提交于 2019-12-10 10:49:58

问题


We have service worker written on top of sw-toolbox. Once the static resources are cached service worker is taking longer time especially for downloading css resources (30 - 100ms) where as for js resources the time is almost 0.

CSS load times :

Load 1 : 35ms

Load 2 : 25ms

Load 3 : 101ms

Load 4 : 22ms

Js load times :

Load 1 : 0 ms

Load 2 : 0 ms

Load 3 : 0 ms

Load 4 : 0 ms

Question :

1.Why css load times are higher with service worker? Would be really helpful to us if someone can provide insight on this.

2.We use preload (async) for loading css , with higher load times for css service worker is fetching css bit late ( after fetching js) due to which page content is getting displayed with out css at first and later with css ( i.e Flickering effect , content without css to content with css)

来源:https://stackoverflow.com/questions/49677586/service-worker-slow-response-times-for-css

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!