dgp1130 / blog

Source repository for my personal blog.
https://blog.dwac.dev
3 stars 2 forks source link

Progressive Web App #38

Open dgp1130 opened 2 years ago

dgp1130 commented 2 years ago

The blog should be installable as a progressive web app. TBH, I don't know why anyone would want to install it, but I see no reason not to support it. Installing a service worker should be straightforward, though I'll need to figure out the caching strategy. Since this is a content-based site, there's no obvious minimum set of assets to provide value.

I'm thinking it can prefetch the basic list of resources (core images, fonts, home page, etc.) then cache any downloaded for X days to support users who might be reading a long post, get side tracked, and come back to it later. If they haven't looked it in a few days, it's probably safe to evict that content and free up the space.

Should investigate Workbox to see if that can be a good solution for managing the service worker and its cached content, since that's most of the problem that needs to be solved here.