News for hackers. Stuff that matters.
Re:The myth that you can’t build interactive web apps except... by EionRobb on Sunday November 17, 2024 @02:01PM (#42166137)
For a multi-page app, one of the important uses of serviceworkers is pre-loading and caching resources that aren't on the first page. eg you might have a background image that's only displayed three pages deep but can download and cache it as soon as the site is open.

You can potentially use http2 push to send down files from the server early but I've seen the browser drop the files if they're unneeded for that page load.

Yes, there are other hacks you could do to make the browser download the resources early, like invisible images or preload audio files, but if you're going down that path why not put in a service worker instead and have it download in the background.

Re:The myth that you can’t build interactive web apps except... by jeroenhd on Sunday November 17, 2024 @02:54PM (#42166608)
Unfortunately HTTP/2 push is basically dead. Very few sites made use of it and Chrome removed it: https://developer.chrome.com/blog/removing-push
Re:The myth that you can’t build interactive web apps except... by xnx on Sunday November 17, 2024 @07:53PM (#42168719)
If preloading is the goal, would hidden/off-screen loading be an option for images?
Re:The myth that you can’t build interactive web apps except... by bastawhiz on Sunday November 17, 2024 @09:49PM (#42169312)
Preload link tags work great and have been supported for over a decade.