patriciogonzalezvivo / thebookofshaders

Step-by-step guide through the abstract and complex universe of Fragment Shaders.
http://TheBookOfShaders.com
Other
5.96k stars 677 forks source link

Draft: PWA support #408

Open gormonn opened 9 months ago

gormonn commented 9 months ago

PWA allows you to install a book as an application on a smartphone or computer, having previously cached the necessary resources.

This is an alternative way to read a book offline. And unlike classical methods (epub/pdf), interactivity is preserved, including viewing and editing shaders.

Additionally, if there are updates to the book, the PWA will be able to update to the latest version when the network comes online.

This will work well on Android. And it’s not clear how it will work on the iPhone, due to small caching quotas. The resource dump is about 70 MB, including pages in all languages, shaders, styles, and libraries.

Basic functionality has been implemented, but not yet tested.

Estimated roadmap: [ ] - cache only the language that the user selects [ ] - give the user the choice to launch the service worker explicitly, at the user’s request, to avoid network load [ ] - remove garbage [ ] - add useful information to manifest.json [ ] - update docker-compose? (it is necessary to rebuild the service-worker build before restarting the server in order to update the caching keys for those files that have been changed) [ ] - move code from src/pwa to git submodule? [ ] - test cache invalidation when updating resources [ ] - test the build