Re:Turn your website into a Progressive Web App
by fenwick67 on Wednesday July 12, 2017 @03:44PM
(#14755923)
Service workers can manually cache stuff ahead of time if it thinks you will need them later.
For example if you visit the admin login page, it can trigger a fetch of the assets for the admin page, then stuff them in its own cache.
Re:Turn your website into a Progressive Web App
by sloppycee on Wednesday July 12, 2017 @04:13PM
(#14756217)
Service workers are not needed, and manually managing the cache seems overly complex.
Re:Turn your website into a Progressive Web App
by SimeVidas on Thursday July 13, 2017 @12:35AM
(#14758742)
Repeat visit, of course :) The service worker can't do anything before it's installed (during the first visit). The browsers' network cache is great, but IIUC the browser still performs those 'if-modified-since' requests, doesn't it? Additionally, depending on your server setup and CDN, some assets may have a short max-age value, meaning they're reloaded more often than needed. With service worker, the website can create its own cache and have full control over it. In other words, the site can guarantee that its assets will be loaded directly from the browser's memory.
EDIT: still talking about regular websites? First visit or repeated visit? Most website already can take advantage of plain browser caching and service worker is IMO hard to sell here.