FREE THOUGHT · FREE SOFTWARE · FREE WORLD

Home » WordPress »  Vetted – Top 3 WordPress Speed Plugins

Vetted - Top 3 WordPress Speed Plugins

by Charles Torvalds 14 comments

[hide]

There are so many WordPress plugins out there now that I wanted to post my favorite 3 plugins for speeding up a WP-Powered blog (including one of my plugins). These are the 3 plugins that I install for pretty much all of my WP-Powered sites, which I run about 300 now. They work together to provide a very optimized blog for speed.

Top 3 WordPress Speed Plugins

  1. DB Cache Reloaded
  2. WP Super Cache
  3. AskApache Crazy Cache

WP Caching Overview

Each request to your blog has to fire up the php interpreter and query the mysql database to create the output that you see in your browser. Using a plugin like WP Super Cache simply saves the output of that request as a static HTML file and serves that to a request instead of using php and mysql every time. DB Cache Reloaded takes this a step further by optimizing the mysql queries. Finally, AskApache Crazy Cache is used to keep a cache fully primed and ready.

Why Caching?

If you have a private server, or you want to keep your MEMORY, BANDWIDTH, and CPU usage down for your server, these plugins will be dramatic. If you have a site that is updated maybe once a month and gets a very small amount of traffic, then the AskApache Crazy Cache would be redundant. That plugin is geared for the heaviest traffic sites.

Request and Response

Most HTTP communication is initiated by a user agent (browser) and consists of a request to a resource on some origin server. In the simplest case, this may be accomplished via a single connection (v) between the user agent (UA) and the origin server (O).

             request chain ------------------------>
          UA -------------------v------------------- O
             <----------------------- response chain

If a browser requests a WP-driven page, the server generates the response (the outputted html) by loading a php interpreter or module to read the WP php files and load all the settings. WP stores the settings in a mysql database and has to query the mysql database for all the data (like the content of your post that becomes html). Finally php sends the output through the server back to the browser. This is the norm for most PHP applications. Every time an interpreter is loaded additional CPU and Memory are used. And perhaps even more troublesome for shared-hosting using a virtual or network filesystem, each load causes many hard-disk accesses, additional processes, etc.

Cache PHP

By saving the php-generated output of a page to a static html file, your server can entirely skip loading a php interpreter or other process. Originally servers were needed and created to essentially open a static file on disk and send that file back to the requesting user. So servers are specialized for this as it's their core function.

WP-Super cache does this for you by saving the output into a static html file, and by instructing the server to skip loading php. It basically only uses php for creating the cached version, in the same way that you can save this webpage as an html file, WP-Super cache saves all the WP-blog permalinks to static files.

DB-Cache Reloaded does something entirely different, it saves the mysql queries that are made to the WP-database, as well as the mysql results to static files, and then through php serves those cached-files instead of re-querying the mysql database. Most mysql databases are stored on separate servers, and although many are on the same local network there is a limit to how many queries, and how many connections can take place. But mysql is maybe the fastest thing I've seen, so your bottlenecks almost never happen there (if configured correctly).

So DB-Cache Reloaded basically makes WP-Super Cache work alot faster when generating the cache files, and DB-Cache Reloaded helps in a number of areas un-related to WP-Super Cache, like in the admin panel. And DB-Cache without WP-Super-Cache is a joke because it still uses the application-level and php for everything. Gotta use both (or just WPSC).

AskApache Crazy Cache is a plugin I wrote to do one thing very well, it runs at intervals via the WP-cron and forces WP-Super-Cache to create a static cache file for all the posts, pages, etc. on your site. Without this WPSC likes to do dumb things like try to manage it's own cache with stale files and expired files, which equals a lot more php interpreters getting loaded instead of cached static files. For sites with more than a visit/page/10minutes this plugin keeps a full primed cache built by WPSC.

Compression and WP-Super Cache

Enabling compression in WP-Super Cache is almost always a great idea. I've never had a problem other than some php compat issues with not-updated php installations. This option basically lets WP-Super Cache compress the generated output of a page and save that to the static file. Normally Apache, Lighttpd, Nginx, etc. open the static file and compress it before it is sent to the browser, then the browser automatically decompresses it to view. This happens so fast because it is run by the server.

This lets WPSC instruct your server to send the compressed version to all browsers that accept compression, and send the uncompressed static file to any other browsers. So this is helpful because it eliminates your server having to do any transparent compressing, it can instead just focus on what it does best, serving static files.

PHP is an application so it requires memory, hard-drive access, and CPU time. Check out the protocol hierarchy:

       +------+ +-----+ +-----+       +-----+
       |Telnet| | FTP | |Voice|  ...  |     |  Application Level
       +------+ +-----+ +-----+       +-----+
             |   |         |             |
            +-----+     +-----+       +-----+
            | TCP |     | RTP |  ...  |     |  Host Level
            +-----+     +-----+       +-----+
               |           |             |
            +-------------------------------+
            |    Internet Protocol & ICMP   |  Gateway Level
            +-------------------------------+
                           |
              +---------------------------+
              |   Local Network Protocol  |    Network Level
              +---------------------------+

DB Cache Reloaded

DB Cache Reloaded Plugin Page - News

DB Cache ReloadedThis plugin caches every database query with given lifetime. It is much faster than other html caching plugins and uses less disk space for caching.

I think you've heard of WP-Cache or WP Super Cache, they are both top plugins for WordPress, which make your site faster and responsive. Forget about them - with DB Cache Reloaded your site will work much faster and will use less disk space for cached files. Your visitors will always get actual information in sidebars and server CPU loads will be as low as possible.

Why is DB Cache Reloaded better than WP Super Cache?

This plugin is based on a fundamentally different principle of caching queries to database instead of full pages, which optimises WordPress from the very beginning and uses less disk space for cache files because it saves only useful information. It saves information separately and also caches hidden requests to database.

WP Super Cache

WP Super Cache Plugin Page - News

WP Super CacheThis plugin generates static html files from your dynamic WordPress blog. After a html file is generated your webserver will serve that file instead of processing the comparatively heavier and more expensive WordPress PHP scripts.

The static html files will be served to the vast majority of your users, but because a user's details are displayed in the comment form after they leave a comment those requests are handled by PHP. Static files are served to:

· Users who are not logged in.
· Users who have not left a comment on your blog.
· Or users who have not viewed a password protected post.

99% of your visitors will be served static html files. Those users who don't see the static files will still benefit because they will see regular WP-Cache cached files and your server won't be as busy as before. This plugin will help your server cope with a front page appearance on digg.com or other social networking site.

Why is WP-Super-Cache better than WP-Cache?

This plugin is based on the excellent WP-Cache plugin and therefore brings all the benefits of that plugin to WordPress. On top of that it creates copies of every page that is accessed on a blog in a form that is quickly served by the web server. It's almost as quick as if the you had saved a page in your browser and uploaded it to replace your homepage.

Will the Super Cache compression slow down my server?

No, it will do the opposite in fact. Super Cache files are compressed and stored that way so the heavy compression is done only once. These files are generally much smaller and are sent to a visitor's browser much more quickly than uncompressed html. As a result, your server spends less time talking over the network which saves CPU time and bandwidth, and can also serve the next request much more quickly.

AskApache Crazy Cache

AskApache Crazy Cache Plugin Page - News

AskApache Crazy CacheThis sweet little plugin does one thing very well. It caches all the posts on your entire blog at the same time, if you are using WP-Cache, WP-Super-Cache, or Hyper-Cache.

                              +---------+ ---------      active OPEN
                              |  CLOSED |                -----------
                              +---------+<---------      create TCB
                                |     ^                   snd SYN
                   passive OPEN |     |   CLOSE           
                   ------------ |     | ----------          
                    create TCB  |     | delete TCB            
                                V     |                         
                              +---------+            CLOSE    |    
                              |  LISTEN |          ---------- |     |
                              +---------+          delete TCB |     |
                   rcv SYN      |     |     SEND              |     |
                  -----------   |     |    -------            |     V
 +---------+      snd SYN,ACK  /          snd SYN          +---------+
 |         |<-----------------           ------------------>|         |
 |   SYN   |                    rcv SYN                     |   SYN   |
 |   RCVD  |<-----------------------------------------------|   SENT  |
 |         |                    snd ACK                     |         |
 |         |------------------           -------------------|         |
 +---------+   rcv ACK of SYN         /  rcv SYN,ACK       +---------+
   |           --------------   |     |   -----------
   |                  x         |     |     snd ACK
   |                            V     V
   |  CLOSE                   +---------+
   | -------                  |  ESTAB  |
   | snd FIN                  +---------+
   |                   CLOSE    |     |    rcv FIN
   V                  -------   |     |    -------
 +---------+          snd FIN  /          snd ACK          +---------+
 |  FIN    |<-----------------           ------------------>|  CLOSE  |
 | WAIT-1  |------------------                              |   WAIT  |
 +---------+          rcv FIN                              +---------+
   | rcv ACK of FIN   -------   |                            CLOSE  |
   | --------------   snd ACK   |                           ------- |
   V        x                   V                           snd FIN V
 +---------+                  +---------+                   +---------+
 |FINWAIT-2|                  | CLOSING |                   | LAST-ACK|
 +---------+                  +---------+                   +---------+
   |                rcv ACK of FIN |                 rcv ACK of FIN |
   |  rcv FIN       -------------- |    Timeout=2MSL -------------- |
   |  -------              x       V    ------------        x       V
     snd ACK                 +---------+delete TCB         +---------+
     ------------------------>|TIME WAIT|------------------>| CLOSED  |
                              +---------+                   +---------+
 
                      TCP Connection State Diagram

November 29th, 2009

Comments Welcome

  • Cracks

    Have you used, or tested, W3 Total Cache plugin ..? (http://www.w3-edge.com/wordpress-plugins/w3-total-cache/)

    I swapped from WP Super Cache after reading some comparisons of W3 Total v's WP Super.

  • http://blog.psax.de Ben

    I first used the wp-super-cache Plugin but after a short period I switched to the db-cache-reloaded plugin, it makes my blog really faster, another good point is that I can make changes on my blog and don't have to clear the cache every time I want to see my changes.

  • http://kalyx.fr Kalyx

    Hi,

    I recently read (i don't remember where) that w3-total-cache was better than wp-super-cache. What's your opinion about that?

    Serge

  • http://edmundxwhite.com Nedsferatu

    Another great post, thanks! I have experimented with this approach and got some great results. I've been using wp-supercache for years now but the three plugins together really give a noticible increase in rendering speeds. I recently (and briefly) played with W3-total-cache but didn't have a lot of success with it. plugins like wp-minify and the three listed here are easier to configure and maintain. i'd love to hear other's experiences as well.

  • Cracks

    @ Kalyx

    You might have read the same Yoast article as I..? http://yoast.com/wordpress-2-9-geeky-bits/

    He says (in his comments) "W3 Total Cache, hands down" when asked about the WP Super Cache V's W3 Total Cache comparison.

  • Matt

    Just installed all three on my blog, and now in my referral logs i see this:

     http://www.askapache.com  16038

    Why does it show 16,000+ referals from askapache.com?

  • http://www.askapache.com/ AskApache

    @ Nedsferatu

    Word!

    @ Matt

    Actually the way the AACC plugin works is pretty simple as it was one of my earliest attempts at a WP plugin and socket networking with php in a real way.

    The way that ALL the caching plugins work (hyper, wp-super, wp-cache, etc.) is by creating a cached resource for a page when it is requested by a visitor. A request causes WordPress to generate the html, and the caching plugins control saving that output to a static file or database entry, and then determining how often to send the static cached file until it should be re-generated. It is essentially an extremely low-memory intensive (compared to almost every other plugin) sequential url requester. Arriving at this plugins design came about in 3 stages that you can read about if you desire.

    Snoopy Fsockopen HTTP Class for PHP Speedy Forms using background-requests

    @ Cracks

    Since writing the AACC plugin I have been developing my own caching plugin designed from scratch (like hyper-cache's original design) to be as good as I can make it. I've been using it on this blog for over a year and am planning to release it within a year... A custom socket-level class optimized for low-memory usage and speed + all the htaccess caching and server tricks like storage and permissions is what I have.

    So I look at ALL the WP caching-related plugins and pick the source code apart looking for any cool code I can use (most of it's crap), since I'm definately still learning how to write optimized php. I also very actively view the disk IO, swap usage, CPU, etc..

    But actually, I haven't checked out the plugin you mention in enough detail.. Thanks I'm going to have to check that out.. I will say that of all the plugins I liked the hyper-cache model the most for being the most optimized, though it's clear I recommend WP-Super-Cache.

  • http://blog.deigote.com deigote

    Hi,

    I was checking some of your post - great job :D - and I noticed the feed link seems to be broken:

    $ wget -O - http://www.askapache.com/feed > /dev/null
    Connecting to www.askapache.com|208.86.158.195|:80... 302 Found
    Location: http://feeds.askapache.com/apache/htaccess
    wget: unable to resolve host address `feeds.askapache.com'

    Hope you'll fix it, because I would love to subscribe :D

    Regards

  • curious george

    I got what Matt got, too - what is that about? I've deactivated the plugin for now.

  • Cracks

    @ AskApache ~ great, can't wait to see, and test, your cache plugin. And if you have some opinions on the W3 Total v’s WP Super, let us all know could you.

  • Cracks (Cracks)

    @ deigote ~ I use this feed link, which works fine for me - http://feeds.askapache.com/apache/htaccess

    • http://www.askapache.com/ AskApache

      Working on it right now.... :)

  • http://bobdavis321.blogspot.com Bob Davis

    Really static was about twice as fast according to Google until we upgraded to WP 3.0 now they both come in at 3 seconds. Y slow says it is 1 second. So who do you believe?

  • Paul030

    Three questions:

    1. Will AACC be updated to work with WP 3.1.1?
    2. Can this work with other cache plugins, like Quick Cache?
    3. Will this work on Cloud hosts like Rackspace?

    Much appreciated.

My Online Tools

Related Articles
Twitter

  • askapache: Today in 1965 DEC announces PDP-8
  • hubail: RT @askapache: Make sure you unplug your Ethernet when leaving the room, or disable wifi
  • askapache: Make sure you unplug your Ethernet when leaving the room, or disable wifi
  • askapache: My servers, and me, are getting annoyed. Fail2ban works fairly well against all the Chinese brute forcing going on
  • askapache: Can't the Chinese stop ordering their hackers to hack us? Ugh
  • askapache: All I want for my bday is a bottle of American whiskey :)
  • askapache: The first Dino fossil wasn't found until 1822, we sure are young
  • askapache: Htaccess - Ultimate HowTo:  t.co/XMmRKFIWuG 
  • askapache: Show Events that Occurred on this day in the Past:  t.co/5u33s4OolA 
  • askapache: Linux / UNIX: Create Large 1GB Binary Image File With dd Command  t.co/2xs3pvudOz  via @nixcraft

My Picks
Newest Posts

WordPress Development
Hacking and Hackers

The use of "hacker" to mean "security breaker" is a confusion on the part of the mass media. We hackers refuse to recognize that meaning, and continue using the word to mean someone who loves to program, someone who enjoys playful cleverness, or the combination of the two. See my article, On Hacking.
-- Richard M. Stallman






It's very simple - you read the protocol and write the code. -Bill Joy

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution 3.0 License, just credit with a link.
This site is not supported or endorsed by The Apache Software Foundation (ASF). All software and documentation produced by The ASF is licensed. "Apache" is a trademark of The ASF. NCSA HTTPd.
UNIX ® is a registered Trademark of The Open Group. POSIX ® is a registered Trademark of The IEEE.

Site Map | Contact Webmaster | License and Disclaimer | Terms of Service

↑ TOPMain