Speeding up WordPress

I finally got B-2 Bomber working right – turned out to be a bad plugin.  It was a pagination script that turned those little “previous/next entries” tags at the bottom into nice little numbers.  Unfortunately, I think it must have been doing a total page count every time a page loaded.  That’s why the homepage was loading slowest of all – it had to count every single page in the blog.  The categories loaded more quickly because they have fewer pages to them, and so on.

Now the site’s running just under lightspeed, despite having over 4,000 comments and 500 entries, plus a fair amount of images and so on.  I streamlined the hell out of the theme.  I compressed my CSS with this little gizmo, which finds duplicated stuff and whitespace and all that stuff and hoovers it right out for you.  I turned on internal caching by following the instructions here under Enable Object Caching, but then I turned it back off because another site warns that Dreamhost and some other shared hosts will cache things to another remote server and you need to have your cache directory writable.  I think that’s the case with mine.  But as far as I can tell, you can’t break anything by trying it, so give it a shot and see if it makes a difference.

Lessons learned:

  • The lightness or minimalism of your theme is directly proportionate to how fast the site runs.  Slimmed themes = good.
  • If your plugins are loading Javascript at the top of the page, make sure they’re worth it.  Delete the ones that aren’t.  Often, you can find other plugins that will do something similar enough without adding that stuff.  Or at least not so much.
  • Plugins can also load CSS into the head.  Sometimes you can remove it from your plugin and stick it into the main CSS document – that doesn’t help on load time, but it does put less code between the top of the page and the content, as a bot sees it.  And then if you compress your CSS after all, it will help load time.
Related posts:
  1. Speeding up older WordPress blogs
  2. Stupid WordPress trick
  3. Theme test drive Wordpress plugin
  4. SEO tip for Wordpress themes
  5. Make a leaderboard load after the content in Wordpress

6 Responses to “Speeding up WordPress”

  1. Apache Guru said:

    You are missing 1 little piece though, you should encourage people to also implement a server-side caching scheme to send out the correct caching headers with static content such as images, javascript, css, pdfs, favicon.ico, etc..

    Read about it: htaccess Caching

    Great article! I subscribed to your feed

  2. Sapphire said:

    Thanks! You know, I read about that on your site (a while after I wrote the article). Unfortunately I didn’t have the technical knowledge to follow it. :D

    Hopefully some of my readers can make use of your article, though! :)

  3. Reaper-X said:

    Actually other than enabling object caching, i also enabled the Gzip Compression (for page and css) :)

    btw thanks for the link

  4. Sapphire said:

    The only reason I didn’t mention that is that it didn’t work on my particular blog. I don’t know what it is about gzip, but I’ve had it work on some blogs and not others- maybe a host setting issue? In any case, it wasn’t working on any of mine, so since I couldn’t test it, I didn’t report on it. But I included the links so people would see your other suggestions, too. :)

  5. Make it fly | www.redips.net said:

    Yes you are right, with lighter theme and carefully selected WordPress modules your site can became quicker. But, you should also try to benchmark WordPress. From my experience, requesting only PHP page on fresh WordPress installation is very slow (no images, no JavaScript, no CSS). WordPress benchmark give result of only 3.44 requests per second. After WP-Cache installation, score was 235 requests per second. I hope that site will be able to survive peaks if article appears on frontpage of digg.com :)

  6. Sapphire said:

    This is a really old post. I have since had sites do just fine with the Digg effect using both WP-SuperCache and HyperCache.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>