Jump to content

Module: ServiceWorker


johannes
 Share

Recommended Posts

  • 4 weeks later...

Thanks Johannes for the module.

I got it running , but checking with the dev tools in Chrome I got no 'OK' in the response column for the requested cache items (see picture). Looking at

https://developers.google.com/web/fundamentals/getting-started/codelabs/your-first-pwapp/

they show a 'OK' in that column. So I am not sure whether the caching works correctly or not.

(Update: In Firefox Dev edition it shows OK for the responses)

 

pwa_cache.jpg

  • Like 1
Link to comment
Share on other sites

Hello Werner,

I'm glad you got it working. I tried to figure out why this is happening but I couldn't get my head around it just yet (maybe it's a Chrome issue?). Among some other sites, I use the module on my own website (https://johannesdachsel.com) as well. I checked the dev tools on there and everything seems to be working fine as I get the OK response for cached assets.

What does your Network panel in the dev tools say? Are there any clues on wether or not the assets are delivered from cache?

 

Link to comment
Share on other sites

I've checked the network panel and it looks the files are coming from cache ( I have files with 'from service-worker' and with a little gear-wheel symbol). I also have checked your page with my Chrome browser and I saw the OK for the requests. So there is definitely a difference. But doing this comparison between your and my installation something more 'shocking' grabbed my interest. The first request (for the HTML) shows a significant 'stalled' time - waiting and doing nothing like a hick-up. This is about 500ms on your page and about 300ms on mine. If this is the price for the service-worker I think it would be a bad 'improvement' - but I am still positive that it is just the struggle with a brand new technology and we will find out who is pulling the brake.

 

stalled.jpg

Link to comment
Share on other sites

  • 1 year later...

Hi, I would use Service worker for additional tasks like push notifications.

Instead of build another service worker module it would be great to add (custom) code to the existing service worker?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...