Three Simple Ways To Speed Up WordPress

Three Simple Ways To Speed Up WordPress

This is a guest post by programmer extraordinaire, Funkey. He was tinkering with WP before you had even heard the word blog; so listen up and learn!

Quite often, I will hear the words: “I signed up for their hosting, but it seems really slow …” followed by “do you have any ways I can fix this? some seconds later.

Although the question never catches me off-guard, I still need to think about it for a while — I have been tinkering with WordPress since the dark ages and an a Systems Integrator by trade, so hacking code and altering settings doesn’t phase me, but on shared hosting, you often don’t have the authority to play with the system — and dedicated hosting, while more ‘tinkerer-friendly‘ still isn’t the easiest thing in the world.

So for my first article for ThemeGrrl, I am going to show off three plugins you can use to make speeding up your WordPress website simple and very effective.

WP Super Cache

Written by Donncha O Caoimh, Irish WordPress Developer

With over a million downloads from the WordPress Plugins repository, this plugin has to rank as one of the best and easiest ways to boost the performance from your WordPress installation, usable on both Windows and UNIX hosting providers and featuring an one-click .htaccess updater, the ability to turn on compression of your pages dynamically depending on your hosting providers setup and full compatibility with many third-party plugins and themes — WP Super Cache really is a one-click way to get a substantial boost in performance on your website.

WP Super Cache works by sending subsequent pageviews to your viewers as a static HTML page, provided nothing has been changed (ie. not comments have been left, or posts have been updated) on a page since the last time someone looked at it.

To install WP Super Cache, click Add New from the Plugins menu within the admin, click Featured and then use the Install button next to WP Super Cache.

WP Widget Cache

Written by Andrew Zhang

Do you use Widgets on your blog? Perhaps an RSS feed, a search bar, calendar or “Featured Post” plugin? If so, WP Widget Cache is a plugin that may improve the response time dramatically, by reducing the amount of queries a widget has to send to your database if certain conditions have not altered since the last time a request was made.

As an example, I configured a new WordPress installation and enabled the default theme with three widgets, moving the Search Box, Recent Comments and Archives into Side Bar #1. I then went to the main site from a different computer and WordPress stated 42 queries had been made to the database to show the page.

After downloading WP Widget Cache and configuring those three widgets to automatically cache themselves for 3600 seconds (the same amount of time as WP Super Cache caches the rest of the page), I went back to my machine, restarted my browser and reloaded the site — WordPress stated only 10 requests needed to be made to show exactly the same page.

Not a bad performance boost for a page with 1 post, 1 comment that had not been altered 🙂

To install WP Widget Cache, click Add New from the Plugins menu within the admin, enter “Widget Cache” and then use the Install button next to the WP Widget Cache entry.

note: WP Widget Cache may warn you that is untested on your version of WordPress, we can assure visitors that it works fine under WordPress 2.9.

So, now we have all the pages and widgets cached, is there any other surefire ways to make WordPress faster?

Google has the answer.

Use Google Libraries

Written by Jason Penney

One thing to remember when considering the cachability of a webpage is the location of the various components within that page — put simply, a browser goes looking for a particular piece of code at a particular location, if it finds it locally (in a browser cache on your computer), it uses it, if not — it is downloaded.

A lot of themes, as well as WordPress itself contain a scripting framework (Prototype, JQuery and Mootools to name a few) to provide many of the cool features your site depends on every day.

Unfortunately these scripts are locally packaged with individual themes and plugins, meaning your website has one, or possibly more copies of each of them — each one of these scripts, like any other software program — has a version number, further complicating matters.

To explain the problem, imagine Site Alpha is using a theme using Prototype 1.6.0 and Site Beta is using Prototype 1.6.1 with theirs, Prototype is 125 kilobytes in size, comparable to a high quality image download — if neither site is using the Use Google Libraries plugin, your browser will have two copies of a script that is only loaded for that site individually.

Now, if Site Gamma comes along and says, we’re using a theme that also uses Prototype 1.6.1, your browser won’t go looking for the copy Site Beta has already downloaded, it will simply download it again from Site Gamma, wasting another 125 kilobytes of your bandwidth and putting extra load on their server.

At this point, Site Beta and Gamma both decide to use this plugin, which transparently alters the header.php/footer.php files to point to Google’s repository of these scripts, rather than the individual copies on both sites.

Your browser, taking the location into account, says “did we get Prototype 1.6.1 from Google” when deciding which copy to use, receives a positive response and then continues to load the rest of the page from Sites Beta and Gamma, while using the already locally disk-cached copy of the Prototype script.

Coincidently, while Google host all of the major scripts in use with most web-based projects such as WordPress — they have made a commitment to host every version of them too, so it doesn’t matter which version of a particular script framework your theme or plugin decide to use, it’s all cached from Google’s servers.

To install the Use Google Libraries plugin, click Add New from the Plugins menu within the admin, enter “Google Libraries” and then use the Install button next to the Use Google Libraries entry.

note: There are no configuration options for the Use Google Libraries code, it is all designed to be completely transparent.

Well, there you go — three really simple ways to squeeze more performance from WordPress — i’ll be covering a slightly more detailed setup on WP Super Cache in a future article — but anyone with any questions, feel free to pop a comment below.

Sorry, comments are closed for this post.