High Performance WordPress

Here at beachdog.com we did a complete overhaul of the Long Beach Visitors Bureau website, funbeach.com. We migrated over 150  static table-based html pages into WordPress. We were able to leverage WordPress to present custom data information and make the site more interactive. Overall, we were thrilled with how it turned out.

Due to the high traffic of the site one of our goals from the start was to maintain performance while we took advantage of what WordPress has to offer (No more requests to tweak content — Yes!). To do this we used a technique called caching. Caching is needed because any dynamic data-driven (WordPress included) has more complexity and therefore a greater server footprint than a simple static site.

For example, let’s look a simplified view at what happens when you want to see the home page in a WordPress site.

  1. It all starts when a web page (e.g. beachdog.com) is requested using a browser.
  2. The request gets managed by a series of PHP files. (code)
  3. The PHP files are evaluated by the PHP Interpreter.
  4. Eventually, a request to the database is made to get the unformatted content of the page.
  5. Database responds with the requested information.
  6. The database information is formatted according to the theme of your site.
  7. The pretty formatted result is returned to the browser.

The bottom line is that takes a little bit of time and consumes server resources to do this. The critical part to take away is this happens everytime a page is requested. On high traffic sites this can be problematic.

Caching simply works by storing the result of a particular request (e.g. show me the homepage) and then using it for future requests (e.g when the next person requests the home page). So, the previously mentioned song and dance only happens once. Periodically, we clear our saved results to ensure we have the most recent content.

As far as implementing caching in WordPress, we don’t have enough nice things to say about the W3 Total Cache plugin. It makes setting this up a relative  breeze.