Recommended PWA approach

First of all awesome work on Frontity! I spent a day learning and whipped a quick PoC and my boss liked it so we’ll be picking up Frontity. I have to also mention the excellent support I’ve seen here!

Now onto my question. I know PWA is listed as coming soon but for those of us who cannot afford to wait, what advice can we get for doing it on our own while waiting for the official one?

1 Like

Welcome to the community @asyazwan :slightly_smiling_face: I’m really glad to hear that you’re planning to use Frontity in your project.

I’ve opened a Feature Discussion to talk about the possible support for Progressive Web Apps. If you want to develop it on your own, as explained in that discussion, you have to make sure to meet three requirements according to Google:

  • Your site is served over HTTPS.
  • Includes a Web App Manifest with your site info.
  • Registers a service worker with a functional fetch handler.

We still have to investigate it further, but here you have some points that could help you:

  • This WordPress plugin could help you to achieve this, and they add a detailed explanation on its readme. It will create a manifest and a service worker with the minimal requirements, and I haven’t tested it but I think you can add more functionalities if needed.

  • The plugin will create these static files inside your wordpress backend domain (https://wp.mysite.com), while Frontity will run in a different domain (https://mysite.com). This means that you may need to add some redirects to redirect mysite.com/manifest to wp.mysite.com/manifest and the service worker as well.

  • Apart from that, you may want to add some functionalities to the service worker, for example adding some cache for the REST API.

By the way, we are working on a solution, that we call PHP Theme Bridge, to let Frontity users have everything under the same domain, and prevent this kind of problems.

Let us know if this helps, and if you start working on it, we’d love to know how it goes and see if we can help you somehow :slightly_smiling_face:

1 Like

I’m afraid that getting the manifest from the PWA plugin is fine but service workers are not going to work without Frontity supporting them via Webpack.

Let’s keep the conversation about possible implementations in the Feature Discussion topic: Progressive Web App :slight_smile: