Categories
Learning Optimization

Optimizing wordpress

When the entire WordPress multisite installation runs off a really tiny server, I have to use pretty much every single tip and trick I know in order to keep it on an acceptable performance level (while being secure).

These are the 4 techniques I used to optimize my WordPress installation.

  1. CDN (Cloudflare)
  2. Caching (WP Supercache)
  3. Jetpack
  4. AMP

If there’s anything that I missed out, please let me know and I’ll test it out.

1. CDN (Cloudflare)

Cloudflare

I’ve written briefly about this in the previous post Cloudflare CDN but I’ll go slightly deeper in depth here. There is a plugin that is WP specific and allows you to load optimized-defaults.

In the speed tab, I enabled auto-minify for Javascript, CSS, and HTML. CF will try to cache those static files and attempt to minify them when serving to the clients. I also enabled AMP  (Accelerated Mobile Pages) in the settings*.

* you have to ensure that your site has a mobile version that is AMP compatible. I’ve done this through a plugin in point 4. 

In the cache tab, I left it as standard as it works well with WordPress. I’ve also set the Browser cache expiration to 4 hours, which seems like a pretty nice compromise between the number of updates the end users will see since I don’t write posts that quickly either way.

There are more settings that are only available in the paid tier like the ability to optimize and cache images on CF, this will definitely help to improve loading times. But since I’m cheap, I decided to make use of WordPress.com’s Jetpack plugin which gives me a free CDN for loading images. Point 3.

2. Caching (WP Supercache)

WP Super Cache

Caching on WordPress application level works on the concept of output caching if I’m not mistaken. This allows the site to serve cached dynamic content instead of having the server process each PHP request manually. Applying together with the caching that a CDN provides creates a form of 2 layer cache, this drastically reduces the amount of CPU time my server has to spend on each request.

I simply have to enable it to enjoy most of the benefits that this plugin offers, there are more tweaks that can be done through the expert option but I haven’t spent the time in making that happen yet.

3. Jetpack

Jetpack – WP Security, Backup, Speed, & Growth

This is a plugin by the official WordPress.com, it ties in your self-hosted site with their services, granting free site analytics, SEO, Ads, Image CDN to name a few.

In this case, I used it simply to speed up the loading of images, as well as for the faster/nice looking image carousel. There are even more features if you decide to go for the paid version, but the free one works well enough for me for now.

4. AMP (Accelerated Mobile Pages)

AMP for WP – Accelerated Mobile Pages

This plugin auto-magically transforms your normal WordPress pages/posts into AMP format so that it will load on mobile devices a lot quicker. This plugin allows you to auto-redirect mobile users to the AMP version of the site. It also allows integration with Facebook’s instant article, something which I intend to make use of in the future.

https://www.ampproject.org

AMP is an open-source project meant to accelerate load times on mobile devices, from the limited testing I have, it seems to have a noticeable speed up when I load the site from my phone.

That’s all for now. I probably won’t write an article about securing WordPress as I’m just following guides online for the moment and I’m not really sure what’s the best way of doing things are yet. Suffice to say I’ve done the minimum in securing the site, let’s hope it’s enough.

Leave a Reply