Home » Blog » Improve your website performance by separating concerns

Spiritual Software Engineer

Improve your website performance by separating concerns

The problem

I have a slow WordPress site that will resist all optimization attempts.

What is the most common advice you get for speeding up a WordPress site? 

  • remove unused plugins
  • update all the software
  • use the latest version of PHP 7
  • install a caching plugin

This list is all good advice and things to reach for first, but what do you do when your WordPress install still takes 13 seconds to load a page, even after all the optimization is done?

In my case, the problem was that the website was trying to do too many things. And the optimizations above did not help much. 

Here is what I mean:

  • the website had multi-language support
  • contact forms done with Contact Form 7
  • subscribe popups using NinjaPopus
  • animated sliders on the homepage
  • hundreds of blog posts
  • a WooCommerce store 

Because of how WordPress works, all items were loaded, regardless of the page you were looking at. The multi-language setup was not working well with the caching system. And I could not uninstall any of the plugins because all of them were needed somewhere. WordPress does not do selective plugin loading.

It drove me crazy that I would need to wait 13 seconds to open up a blog post that would request hundreds of resources (CSS and JS) that it did not need. It was a page with one image and some text but a truckload of “invisible add-ons.” This page should load in milliseconds!

Some have suggested writing yet another plugin to remove the unnecessary scripts from the pages that don’t use them. I understand how that would improve the loading time, but on principle, I don’t want to have code that adds stuff, so then I can immediately remove it a few microseconds later. That’s just bad practice

I came up with the solution to split the site into two: one for the simple blog and one for the store. I also dropped multi-language support. 

The Pros

  1. The blog is made up of static pages – so you can deploy very effective and aggressive caching.
  2. I could also split the plugins – there was no need for the blog to load all the WooCommerce code.
  3. The store site could focus better on selling and keeping the buying experience smooth. 
  4. The improvement in performance was dramatic, as I could now optimize each part independently, without conflicts
  5. A bonus side effect is that I can now work on the blog and not worry that the store will be affected and vice-versa.

The Cons

  1. There are now two websites to maintain and think about.
  2. They need to look the same in design, so they feel part of a whole.
  3. The search function is now limited – it either returns post or products – depending on where you are using it.
  4. Tracking the user activity is more complicated.
  5. Adding multi-language support means adding a new site for each language – which does not make business sense right now.

There is an obvious trade-off here. There are more pieces to take care of, but you get to optimize each one individually and fine-tune them for their specific purpose. 

In Conclusion 

If the common performance tunning is not doing much for you, maybe the structure you have is too complex, and your website would benefit from being spit up into smaller but more effective pieces. Of course, this effort only makes sense if having fast loading pages is essential to your business. 

Leave a Reply

Your email address will not be published. Required fields are marked *

five × 5 =