Aaron Bushnell
Aaron Bushnell

Reputation: 291

Progressive web applications and CMS-driven websites

I've been intrigued by offline-first, progressive web applications from talks by developers like Addy Osmani and Jake Archibald. However, when I watch these it always seems to be in the context of a web application where someone would use an SPA to build a chat app, a photo app, and interact with data from an API endpoint.

I typically work with clients who use a CMS to build 10k+ pages that have all sorts of different content of various lengths and combinations: WYSIWYG content, banners, forms, etc.

Are offline-first, progressive web applications possible for CMS-driven work? If so, what are best practices to consider to maintain progressive-enhancement?

Upvotes: 2

Views: 784

Answers (1)

Linh Pham
Linh Pham

Reputation: 3025

In short Progressive Web Apps is a website which have good UX, responsive UI. And it must has Service Worker with a manifest.json.

Are offline-first, progressive web applications possible for CMS-driven work? If so, what are best practices to consider to maintain progressive-enhancement?

So if you are aiming for CMS, your questions will be likely:

1. is it possible to integrate Service Worker in to CMS-driven work?

Answer is yes, regardless technology of either Front-end or Back-end offline-first of service worker does not care about what running at either side, but only handling the "endpoint" of an external request from browser.

For example:

  • you want to make /css/style.css file load-able when offline.
  • all you need to do is tell service worker to cache this file, and use it in case network is not avaialble.

2. what are best practices to consider to maintain progressive-enhancement?

  • It is depend on what CMS you are using (poopular ones are likely have plugins for SW already)
  • What are you prefering. Most of CMS users prefer to handle things through a plugin or some automation tools...

...but in my opinion, plugins for service worker will always limited by the use cases. And it will potentially complexified the work if you want to use other feature like "push", "notification"... etc...

=> So for me best practice is "NOT USING CMS PLUGINS" (hand-code it)

P.S.

If you decide to go for what I have suggested, there is a small js library of GoogleChrome team, which named "sw-toolbox". For short, a simple website will took lesser than 10 lines code and this tool to enable offline-first feature. (be awared that I am not counting background-sync, push, dynamic data caching... or any advance features)

Upvotes: 2

Related Questions