Desktop PWA works with Discourse!

We want to get this working, but the last time we tried with the “You are offline” page wasn’t a great experience. Also we had a lot of suggestions about making reading Discourse possible when you are offline.

Using some libraries from https://github.com/GoogleChrome/workbox I was able to:

  • Remove the “You are offline” page

  • Make Discourse fallback to cache when a network request fail aka Discourse will allow offline browsing of every previously visited page.

  • Get a perfect score in the PWA Lighthouse audit:

  • Get the “Install Site” on the Desktop working (availiable in Chrome canary for now, will land in stable around August)

Technical Details

The changes are pending in this branch: https://github.com/discourse/discourse/compare/offline

A demo site is running at https://discourse-workbox.muito.ninja/

27 Likes