HandBrake / HandBrake-docs

HandBrake Documentation
https://handbrake.fr/docs/
Creative Commons Attribution Share Alike 4.0 International
197 stars 91 forks source link

Adding a Service Worker #41

Closed chrisfinazzo closed 6 years ago

chrisfinazzo commented 6 years ago

As it is kind of 'in the news' (so to speak), I would like to propose that we add a Service Worker to the documentation site.

Tl;dr, I read it yesterday and I'm kind of excited :smile:.

excited

Because these files are generated by marsh build into the public directory and the source is written in Markdown, it raises another question, where should the requisite script tag and sw.js file go? I'm thinking it belongs somewhere in templates/mark1/partials/ with The Service Worker itself in source/docs.

Thoughts?

bradleysepos commented 6 years ago

Indeed, I thought about offline use when I started the documentation project. We actually have an interactive internal web app for visualizing release download statistics that does some intelligent caching of data on both front and back ends that's considerably complex and hugely beneficial to performance and resource management.

Truth be told, I'm not a huge fan of prefetching in general, and find caching for offline use more important for web applications than most web publications, at least where minimalism is desired. One of my major goals for this project has been as few build system and back end dependencies as possible, and minimal HTML+CSS with as little JS as possible on the front end. Lean information, no fluff, as fast as possible. We deployed HTTPS+HTTP2 right off the bat to speed things up further.

All that said, I'm not against service workers by any means, just not as excited about its application to this specific project. We definitely would not be able to cache images on prefetched pages due to bandwidth and load concerns, which straight away removes a large portion of the benefit.

sr55 commented 6 years ago

Aside from the fact I don't really think we want/need offline, it potentially opens a can of worms under Eu data laws as well so my preference would be to keep it simple as it is today and just avoid doing anything more than necessary.