johannes Posted June 6, 2017 Posted June 6, 2017 Adds a Service Worker to your Processwire site which can be customised. The service worker script itself is heavily based on Jeremy Keith’s work – thank you Jeremy! More information: https://github.com/johannesdachsel/processwire-serviceworker 25
Werner Pilnei Posted July 3, 2017 Posted July 3, 2017 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) 1
johannes Posted July 5, 2017 Author Posted July 5, 2017 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?
Werner Pilnei Posted July 5, 2017 Posted July 5, 2017 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.
pwFoo Posted July 4, 2019 Posted July 4, 2019 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?
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now