Tag Archives: caching

Speed Up Your WordPress with Caching

Hey Skuligans & Amature Webmasters:

today’s instalment deals with speeding up your Skule wordpress website. While half the battle is on my (the sysadmin’s) side  – providing decent hardward, up-to-date OS, tweak webserver settings, blah blah – the other half of the battle is ensuring your site is well-optimised by design.

That’s where caching comes in. Each time a user loads a non-cached webpage, the webserver must re-generated the HTML code of your WordPress from raw PHP. Caching, on the other hand, takes the generated HTML and stashes it away for the next time a visitor clicks on your site. While the servers we have contain fast processors, no matter how you slice it, having to do less processing will always be faster.

Enabling Caching

Big Caveat: only attempt this if you have some experience with WordPress before. Unexpected errors can and will pop up for you, so only attempt if you are confident!

Luckily for you, WordPress provides its own set of caching plugins. The two best are the W3 Total Cache plugin,  and the WP-Supercache Plugin.  For Skule usage, the W3 plugin works best right out of the box; the Supercache Plugin requires more configuration. So, lets get installing the W3 Total Cache plugin:

  1. Go to the Plugins page,  click ‘Add’, and search + select the W3 Total Cache plugin from the plugin store
  2. Enter your FTP password to begin installation. If installation fails, check you have write permissions for your wp-content and wp-content/plugins folder. This can be done via Cpanel File Manager.
  3. Once installation is done, you may be greeted about some post-installation items that failed. These are permissions-related. Follow the instructions, and enable write permissions on the files that failed. This can be done via the Cpanel File Manager:
    perms
  4. Once done, enable all the caching modules you desire. The ones you definitely want are Page Cache, Object Cache, Minify Cache, and Database Cache. Unless you know what you are doing, don’t enable any others!
    enable
  5. Make sure to change back permissions on any of the files you changed in step 3!
  6. Caching should now be installed. Load you site to prime the cache; the first load is usually very slow.

Since caching is now enabled, you will have to clean your cache every time you create a new website post; this is done by clicking the ‘Performance’ tab on your WordPress topbar and selecting ‘Empty All Caches’.

Last note: you may have to edit your .htaccess file in public_html folder to allow redirects. You will know if you get “page not found” when click around your site. If so, you need to add this:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Performance Gains & Testing Your Site

Now that caching is up and running, it’s time to test. Pingdom has a great tool for this.

Check it! Here is this site BEFORE caching:

precache

…And here it is AFTER caching:postcache

That’s a change from 703ms before to about 394ms —  close to 50% time reduction! Now go, and set up a cache on your site.