DEV Community

Jake Counsell
Jake Counsell

Posted on

My MVP that's PWA and SPA with just wordpress. I'm seeing 0.5s loads, would adding service workers improve performance?

I think I'm becoming quite neurotic about speed and mobile user experience at this point for a super bootstrapped MVP I'm building but I still feel as though there's tons of opportunity, most if not all pages are loading in 0.3-0.7s with pages ranging from 237k to 437k and vanity scores of 99% / 95%, not sure if I can do anything at this point except switch to a better server (on media temple grid). But I was curious how much of an impact introducing service workers would have if any?

A little more info.

  • All iconography is super optimized inline SVG, either inlined within markup or inlined in the CSS.
  • No third party scripts unless on pages that allow social embedding, analytics are local.
  • I'm using turbolinks for the SPA feel, I was using barba which I liked a lot better but I'm seeing better performance with Turbolinks (probably something wrong I'm doing).
  • CDN is via Cloudflare.
  • All scripts and style are deferred, not render blocking, and only loaded for pages they're needed on.
  • My total calls are 27 at the most.
  • Most if not all JS for the frontend is in a single file.
  • All CSS is in a single file.
  • I'm using virtually zero plugins (commenting, caching, SEO, a user registration plugin that I grossly modified and simplified)
  • All animation is CSS and 60fps everywhere.
  • I built the theme using underscores, but greatly simplified the source.

If service workers would help with say the core navigation and footers, does anyone know how to do that via Cloudflare? It seems less straight forward via Cloudeflare's "Workers". This project has a ton of user functionality and certain areas are pretty media / content heavy so I want things to be as light and nimble as possible.

Top comments (1)

Collapse
 
jimmont profile image
Jim Montgomery

Yes, service workers load from cache making any site faster than without, making the cached assets load nearly instantly. Though they won't help with content updates--Wordpress is dog slow generally. I've done minor performance work on a project or 2 there going from 6+ second load times to under 1s as I remember. Generally it is a product and platform to avoid unless it very specifically addresses some business need.