Precaching WordPress posts with a ServiceWorker

Not quite the solution I was expecting, but I found another plugin that handles Service Worker much better and adds the features I needed, though I have to list posts manually rather than programmatically.

The better plugin is Above The Fold Optimization (ignore the 1 star reviews, it’s one of those plugins where if you use it wrong it WILL break your site, definitely not recommended for amateurs though). It has an optional ServiceWorker you can install including precaching and a lot more options than the seemingly abandoned Mozilla plugin. I even find it more useful and faster than Autoptimize at deferring my CSS/Javascript in a more cache-friendly way.

I’m still not entirely sure why my earlier attempt with the other ServiceWorker implementation wasn’t working, but for now this does in fact fit my criteria of caching specific posts.