Maison Miru Guides is hosted on SiteGround, which is known for having one of the best WordPress caching/optimization plugins out there, SG Optimizer. Along with great technical support, this plugin is one of the reasons that people cite for using SiteGround above other hosting companies.
My experience with SG Optimizer has been a bit of a mixed bag.
Even though our site is pretty simple, I became obsessed with optimizing the speed and – more importantly – optimizing the number of server hits. SiteGround’s critical flaw, if you can call it that, is that their shared hosting plans have pretty explicit CPU/user caps. So, the more you can offload or avoid executing on the server, the more you can squeeze out of your hosting plan. Plus, speed is generally good for SEO.
My go-to site for WordPress performance tips is Online Media Masters. While I think they’ve since switched to Cloudways for hosting, they have tons of great documentation about cranking SiteGround performance, including how to configure SG Optimizer. I turned on all the settings and ran into a number of problems, ultimately disabling a few and installing more specialized plugins instead. Here are the gotchas I ran into – hopefully they can save you a lot of headaches later.
- Optimize Loading of Google Fonts does not respect your “font-display” setting. This one was a fun one to track down. I noticed that my headlines were suffering from a flash of unstyled text (FOUT), even though our fonts load pretty quickly. When logged in to WordPress, this wasn’t happening and I saw that our theme (Astra) indeed uses display=fallback in the Google Fonts fetch URL. However, when looking at the optimized version, I saw that SG Optimizer had inlined our fonts with display=swap. Some people prefer this. I do not, so I actually disabled this setting.
- New Images Optimization is hit or miss. SG Optimizer wasn’t transparent (or at least I never saw evidence) about how well it was recompressing my images on upload. There are a myriad of articles out there about sizing your images appropriately for WordPress. If you’re lucky, whatever editor you’re using will support srcset for images and this will become less of a problem, but I still wanted to squeeze everything I could out of our images, ideally without thinking too hard about it. Shopify, where Maison Miru lives, has a number of quirks around image handling, so I was already familiar with techniques to improve size. Specifically, we use TinyJPG there as it gives great results and tends to trick Shopify into skipping further resizing which would reduce image quality further. Conveniently, they make a WordPress plugin, so I just started using that instead.
- Image Lazy Loading is buggy (or at least was at the time). This issue was recently fixed, but I noticed that some of my images would load fine when logged in and then fail to load in an incognito window. I traced this down to a now-fixed bug in the lazy loading code that doesn’t handle IMG tags with empty “class” attributes. Instead, I switched to the WP Rocket Lazy Load plugin, which did not have this bug + has support for using browser-native lazyload support instead of JS.
- Combining JS/CSS files is not an obvious performance win. This issue took a while to track down, even longer to fix, and will remain an ongoing concern as I add new content to the site. The theory behind this feature is that downloading a single file instead of many will be faster and smaller (if minification is also enabled). The reality here is that if you’re using different plugins on different pages, SG Optimizer will create a different combined file for each of those pages. So, instead of downloading, say, a 2KB file for a specific page and loading all other JS from your browser cache, you’ll instead download an 80KB combined file with a bunch of JS you already have combined with this new content. The workaround here is to find the page-specific CSS/JS (which can be both inline or separate) and exclude it from CSS/JS combination. Not only is this challenging, the SG Optimizer UI doesn’t always find these JS files, so you have to insert some code into your theme’s functions.php to exclude them instead.
- Combining JS files can be buggy. In fairness, SG Optimizer warns you upfront about this, but these issues are annoying tricky to track down. In my case, it turned out that the Facebook Pixel plugin would load, but would not send any events until I excluded some inline JS from combination. I did not have this issue during a brief test with Cloudways and their Breeze plugin, though that one had its own quirks.
- It may not play well with your CDN. I’ve got a whole other rant about CDNs, reverse proxies, and SiteGround, but when I installed the CDN Enabler plugin to wire up my KeyCDN account, I found that my combined CSS/JS files were suddenly empty. It turns out that this is actually a CDN Enabler bug/feature (which can be fixed by applying the patch here), but these sorts of issues are really frustrating to track down.
At the moment, everything is stable and probably as fast as I’m going to get it for now, but the one-click promise of increased performance simply didn’t match my reality and may not match yours.