Caching, GZIP, Minify & CDN - Introduction

The speed of websites has become a hot topic worldwide - Faster page load speed gives the users a better experience while browsing your website, in addition it will benefit you in search engines like Google. (Speed is included as a factor in the calculation of how your site should be placed in search results).
 
You can achieve faster pageloads by using Caching and reduce the workload of the server by providing users with cached files instead of all users create their own database / file calls when a page is visited. This means that your website will be much better equipped to handle large spikes of traffic. (Known as the Digg effect).

I've split up this article about Caching, GZIP, Minify & CDN up in 4 parts, due to the volume.

  • Introduction to caching, GZIP, Minify & CDN (reading now)
  • Configuring W3 Total Cache. (coming soon)
  • Configuring the CDN (Content Delivery Network). (coming soon)
  • Connect W3 Total Cache and CDN. (coming soon)

I have previously used a well-known plugin (WP Super Cache) on my WordPress blogs to cache / compress my data and it has proven good for my needs.
But around a month ago, I stumbled upon a new and fantastic plugin for WordPress - W3 Total Cache, which beats the hell out of WP Super Cache. You get plenty of opportunities to set it precisely to your needs and I will guarantee you it can reduce the load times on your own blog. (when properly setup of course).

To mention some of the possibilities with W3 Total Cache plugin:

  • Caching through disk cache / memcache / APC of your pages, files and RSS feed.
  • Compression with gzip + deflate of your theme, plugins, CSS, JavaScript files.
  • Minify your CSS / JS / HTML / Feed + the opportunity to combine and group the CSS / JavaScript in order to reduce DNS lookup. (requires PHP 5)
  • Caching of database calls.
  • The ability to easily use the CDN. (Content Delivery Network)

Each option gives you plenty of choices to configure them to suit your needs. They will all in various ways help to improve the speed of your blog, and overall, they can actually move a lot.
I just made a few measurements with YSlow on a few of my own blogs you can see below - gives a picture of the effect when it is setup well. (There are still plenty of room for improvement on both blogs, so I expect to reduce the loadtime even more soon)

Page Speed Snyd.dk (Each number is the second calculated average of 10 measurements)
Page / Step Frontpage Category Post Search
Without the use of Cache 6,9 6,2 8,0 6,5
With WP Super Cache 5,8 5,0 6,9 5,1
With W3 Total Cache 3,1 2,9 3,4 2,8
W3TC + CDN 1,5 1,8 2,0 1,3
Page Speed Linkfeed.dk (Each number is the second calculated average of 10 measurements)
Page / Step Frontpage Category Post Page w/o Pic
Without the use of Cache 7,7 4,6 4,7 2,9
With WP Super Cache 6,5 4,0 4,3 2,0
With W3 Total Cache 4,4 2,1 2,1 0,5
W3TC + CDN 4,0 2,0 1,9 0,4

CDN has not a dramatic impact on Linkfeed.dk, but it is also a theme without much graphics in. Besides the thumbnail provider I use is slowing the page down a bit.

You can clearly see from the table that it has paid of to use this plugin - it has reduced the speed tremendously for both examples. Snyd.dk is a blog that has more than 8000 unique visits/40000 pageviews daily. It is really important for me to be able to deliver a super fast webpage for all users. It will do 2 great things - keep the users happy and reduce the load/ressources on my server.
The search engines also give a little bonus for faster page - who wouldn't want that?

W3 Total Cache can be used directly by simply activating it, but the great advantages are first obtained by tweaking every option. You can easily spend several hours on this.
You can get inspired by my setup through the links in top of the post.

Reading material:

Resources:

Commentary

Leave a response »

  1. 1. August 22nd, 2010

    Hej Claus

    Et meget forsinket tak for en god artikel. Faktisk har jeg flere af dine “tuningsartikler” bookmarket i min Firefox – de er sgu kvalitet!

  2. 2. August 22nd, 2010

    Takker Thomas :) altid dejligt når andre kan bruge det man har selv har kæmpet med at få sat lidt i system.
    Gik dog lidt død i at få lavet denne færdig på engelsk :)

  3. 3. October 8th, 2010

    Også lidt ros herfra! God læsning :)
    Dejligt at lære om nye plugins. Og dette lyder som et jeg hellere må få tjekket ud snart!

    Rolf

Trackbacks

Leave a comment, a trackback from your own site or subscribe to an RSS feed for this entry. Trackback URL for this entry Comments feed for this entry

Leave a response

Leave a URL

Preview
Dansk blog Engelsk blog
Twitter Claus Heinrich