A programmatic PWA (service worker) module

Hi, I just finished my PWA module and it’s docs, you may be interested in it.

Features

  • Offline available: offline page and offline image.
  • Installable: can be added to home screen.
  • Precaching: allow precaching pages, CSS, JS, fonts and so on.
  • Cache Strategies1: supports cache first, network first and stale while revalidate.

You can preview it via the video below, the real site and the demo site.

3 Likes

Awesome, thanks!

Are you able to cache external files, like images / JS assets hosted on a separate server?

1 Like

Currently, external files were ignored to be cached (but preaches works with external files). I have an idea how to configure which origin’s assets can be cached, and make it configurable by users, this feature is planned.

1 Like

I added this feature into v0.2.1, you could preview it on the demo site, users can control which origins are trusted, only the same origin (base URL) is trusted by default.

Screenshot on offline.

image

2 Likes

This. is. awesome. Thanks!

2 Likes

@idarek How does this compare to your PWA method? I remember you had something I haven’t had a chance to look at yet.

Simple implementation of PWA on a website with a Mobile First Design approach – Dariusz Więckiewicz :uk: (wieckiewicz.org)

On my list to have a look on that :wink: just need to find a bit of time…

2 Likes