3 ms·
I've deployed a full PWA (by lighthouse standard) and its hard to understand how can you comply with one line of code. Ex how do you define the installable ico
by lucasverra 7y ago
I've deployed a full PWA (by lighthouse standard) and its hard to understand how can you comply with one line of code.
Ex how do you define the installable icon for the Add to home screen icon ?
Or how do you choose what gets in the cache for offline access ?
PS : this is your score https://www.webpagetest.org/result/200227_PT_b799b0e13e0417b61ccb2456633c80f2/ https://www.webpagetest.org/result/200227_PT_b799b0e13e0417b...
- robgibbons 7y agoIt's possible to add head elements with JavaScript, so you could define any number of things with a single added script. Not sure if that's what they're doing here, but certainly a possibility.
- grun 7y agoThank you for the Lighthouse test and great criticism. Iterating and fixing those in real time now. * https://www.webpagetest.org/result/200227_RM_75b0bc807f4fc90b37ea3a3e4f78c965/ https://www.webpagetest.org/result/200227_RM_75b0bc807f4fc90... Great questions. > Ex how do you define the installable icon for the Add to home screen > icon ? Pep tries to source the default icon from the site itself, eg a high resolution favicon, if possible. If unavailable, or a different icon is preferred, the user is prompted for one. But by default, Pep tries to source such data and information the best it can. > Or how do you choose what gets in the cache for offline access ? Requests are observed, in the ServiceWorker, to determine which assets are requested on different pages and across the whole site. Those observations are turned into confidence scores, per asset, to determine which assets should be cached (and pre-fetched if not already cached). You can, of course, pin certain assets for offline caching 100% of the time. But, by default, Pep does its best to cache requisite resources as determined by observed site activity.