Why You Should Use WP-Super-Cache

At Hawk Host we deal with CPU usage issues with accounts like every other host out there.  I’ve noticed an ever growing pattern of the problems always coming from WordPress blogs and almost always they have no caching what so ever.  When a web page is served without any caching in wordpress it will load up PHP then grab the data via MySQL.  These are both the slowest and most intensive portions of a web page.  The images, css files ect. are all served nearly instantly by the web server and it can serve a lot more of these static files per second then PHP pages.

This is where WP-Super-Cache comes into play what it does is when pages are served the first time it checks the caches and if they do not exist it then creates the cached file and serves it.  It has two options using rewrite rules to send users to .html versions if they’re available or to have PHP still handle it but load the PHP files instead.  How the HTML version works is the rewrite rules it inserts into the .htaccess file checks for file existence in the cache folder and if it’s there that’s where the file is served out of.  This is the ideal situation as no PHP being loaded at all means a server can handle a lot of traffic meaning even being on the frontpage of digg may very well be handled fairly easily.  There are some cases where users forget this portion so we always make sure to remind users to get the rewrite rules in.  In a lot of cases their blog goes from using a lot of resources under traffic to being a user we have no idea we’re even hosting.

So how do you know if the cache is working?  Well on each page if you view the HTML source you’ll see something like this:

<!– Dynamic page generated in 0.277 seconds. –>
<!– Cached page generated by WP-Super-Cache on 2009-09-13 14:22:03 –>

You should also make sure the cache page generated time has not changed on a refresh of the page seconds later (tells you it’s broken).  So if I refresh the page again and I have made no changes to the blog I should see this again:

<!– Cached page generated by WP-Super-Cache on 2009-09-13 14:22:03 –>

This tells me the cache is working and the page was served via a html file.

I hope this convinces everyone who is not running WP-Super-Cache to install it now and configure it!  Especially if you’re hosting with us because eventually if your site becomes popular I’m sure you’ll hear from us about installing it to reduce your usage so that your site can scale up much better.

I plan on posting some more WordPress related posts in the next few weeks regarding things I’ve noticed on blogs that decrease performance and increase resource usage.  Hopefully the tips help users who think they might not belong in a shared hosting environment to think otherwise after correcting these issues.

This entry was posted in Tips. Bookmark the permalink.

6 Responses to Why You Should Use WP-Super-Cache

  1. I absolutely agree with you. Everybody should use WP-Super-Cache. Makes your site digg-proof and could significantly lower CPU usage, as well as reduce the load on other parts of the server.

    And not only should you use a cache for wordpress. More and more script offer caching and this should be used. Caching isn’t a bad thing when done right, it is when done wrong.

  2. David Roussel says:

    I’d love you to blog about securing wordpress. It’s an important topic right now.

    I tried setting up digest authentication on /wp-admin URL as I’d read that many attacks hit there. But for me it wasn’t working quite right, and I was often asked to re-authenticate almost randomly. Perhaps not worth a support ticket but worth a blog post.

  3. Pingback:   Suspension Pages – The Unforeseen Bane Of Web Hosting by Hawk Host Blog

  4. nitrome says:

    i prefer use w3 total chace, may you will explain this plugin next time ..? thank

  5. rahul808 says:

    Thank you so much. I will add the plugin right now.

  6. Nikita says:

    One of the nice things about WP Super Cache is that it’s easy to get some benefits from it almost instantly after it’s installed and activated. This plugin is one of my favorite and I never run any site without installing this.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.