Better performance from WP Super Cache

If you use the WP Super Cache WordPress plugin (and you should, if you use WordPress), it has a settings page section titled “Expiry Time & Garbage Collection”. It sets the “Cache Timeout” to 3600 seconds by default, and warns that you should set it lower on a busy site.

That advice makes sense if you have a sudden surge of traffic to a single page. However, if your site is generally very busy across all pages (for example, if you have an archive of hundreds or thousands of posts that are constantly being indexed by search engines), we’ve found that you should do the opposite to improve performance: set it much higher. We recommend setting it to 172800 seconds (which is 48 hours). This can cut your CPU usage in half, which will speed up your site.

The reason for this is that when WP Super Cache creates a cached page, it wants to make sure that those pages don’t build up forever. Every ten minutes or so, it looks through them all and deletes any that are older than the “cache timeout”.

On some servers that use a network file system called “NFS”, looking through a large number of files causes performance problems. That’s why the WP Super Cache author recommends making them expire quickly: it reduces the number of files it has to examine each time.

On our servers, we don’t use NFS and looking through lots of files does not cause a performance problem. Leaving the files for a longer time is safe and increases the chance that a page will already be cached when it’s needed.

If you’re a Tiger Technologies customer who makes this change and you want to see how it affects the CPU usage, just let us know and we can provide you with details.

Updated 2013-06-11 to reflect that the plugin field is now named “Cache Timeout” instead of “Expiry Time”.

23 Comments

  1. How about W3 Total Cache? There’s more features (CDN integration, etc) and it’s able to cache on memory, good for private server but also able to cache on disk (which blogs on shared web hosting usually do).

    Currently I use it for my personal blog (which already perform very good with Tigertech hosting), but even more with that plugin.

  2. yos wrote:

    How about W3 Total Cache?

    We can’t recommend W3 Total Cache, unfortunately. We’ve seen customers switch to it and completely kill the performance of their site.

    We don’t know why it caused problems in those cases, but we’re sticking with WP Super Cache ourselves….

  3. W3 total cache settings are simple (once you understand them), if you have a standalone server use disk enhanced method for page cache — if you have a slow disk or underpowered server disk caching for database or HTML minification is not a good idea. however, if your server is underpowered you’ll definitely want to use the CDN functionality with a good provider like http://maxcdn.com. unfortunately, there are so many options available that some users of the plugin may not know what’s best for their case. the plugin seems to be making those more clear with the next release (i was someone who had trouble understanding all of the options, and once I did everything clicked).

  4. I use scopehosts.com . How can i check if they use NFS ?

  5. You should contact scopehosts.com and ask them. NFS is a basic part of their network infrastructure (if they are actually using it), and only they would know if they are using it internally.

  6. My wordpress blog hosted on lunarpages every week they banned my account due to high cpu usage. How could i use wp-super-cache to work properly and how to set expire time?

  7. pointdesi,

    Without seeing the site ourselves, it’s hard to say what’s wrong at another hosting company. But WP Super Cache, with the tips here and on our WordPress performance page, should dramatically reduce CPU usage, so make sure you try everything mentioned.

  8. thank for advice.

  9. Hi,
    I tested w3 total cache for 10 days on my server, then rolled back to wp-cache. W3 Total Cache is not ready for production in my view. It tested slower than wp-cache, and the support/documentation required for such a complicated plugin is not available. My site is a new blog, very small with almost no traffic. Results here:
    http://wordpress.org/support/topic/w3-total-cache-test-results-vs-wp-cache?replies=1

    In the future, W3 Total Cache might the way to go, but its time has not come yet. Give it 6 months to a year would be my advice.

    Jim.

  10. My site is pretty static. I mean new content is added every day or two. Will it be reasonable to set expire time to say 1 day – 86400 sec? This should decrease server load but I heard about blank page problems in the past … Thanks!

  11. dbunic: We’ve never seen blank pages as a result of increasing the cache on our servers. We can’t rule it out on other company’s servers due to some kind of problem on their end, but it certainly should be safe in theory.

  12. Thanks a lot for your advice, I’ll try. I’ve a question for you: Can google index my pages if i use “Disallow: /wp-content/cache” command in my robots.txt?

  13. delphix wrote:
    >Can google index my pages if i use “Disallow: /wp-content/cache” command in my robots.txt?

    Yes. The robots.txt file entries represent URLs, not file paths; the fact that WordPress grabs something like “http://example.com/postname” from your cache directory is irrelevant.

    (On the other hand, there should be no need to disallow access to your cache directory, because search engines wouldn’t usually be accessing your site via URLs like “http://example.com/wp-content/cache/something” in the first place.)

  14. Thanks for answering, Robert.

  15. Hey,
    In latest edition of W3 Total Cache, its Garbage collection interval in Page Cache tab.
    What is Header expiration time ? This is in Browsers Cache setting.

  16. I was not know how to install this plugin.Then when i install this plugin then i have lost my blog, for this reason i have also lost all of my data and information.Now i am safe.Give me some suggest how to be fast my site.Hear is my site http://inftechworld.com

  17. Infinity Tech World wrote:

    >Then when i install this plugin then i have lost my blog, for this reason i have also
    >lost all of my data and information

    Sorry to hear that! Since our company doesn’t host your site, we don’t have any way of knowing what went wrong, unfortunately. You should post on the WordPress support forums for general questions and trouble with the plugin.

  18. Hi,
    We have a quite big classified site that gets updated per 30 mins. What should be the ideal setings for this to use optimal server load. Thanks. I hope you offer me a good advice on that ( we use Hostgator and they specifically recommand WP super Cache).

    Admin, Adsnity.com

    PS– you should give us an option to subscribe your comments.

  19. vijay wrote:

    >We have a quite big classified site that gets updated per 30 mins. What should be the ideal setings
    >for this to use optimal server load

    We have a Web page showing the settings we recommend: Using the “WP Super Cache” WordPress plugin.

    >PS- you should give us an option to subscribe your comments.

    You could subscribe to just comments using this RSS comment feed to the whole blog, or this RSS comment feed for just this page. (You can just stick “/feed/” on the end of many WordPress URLs and get a working RSS link.)

    But most people (particularly our customers, who this blog is mostly for) will want to subscribe to the whole blog using the link in the right column.

  20. Thanks for this info, will try out the settings.

    I maintain 50+ wordpress sites and advise many on the best plugins, based on my own experience and I can confirm W3 Total Cache kills the sites. I have done lots of testing with different user recommended setups using many to no plugins and different hosts and I still find Super Cache far superior.

  21. Thanks for the tips. What settings would you recommend on the ‘preload’ section of WP Super Cache?
    Also I have a small problem, maybe you could help, when I first fetch a page in google wm tools it is showing ‘Temporarily unreachable’ but when I fetch it a minute later it shows as ‘complete’ Do you think that the ‘Temporarily unreachable’ error is related to cashing plugin ? Thanks.

  22. marek wrote:

    >What settings would you recommend on the ‘preload’ section of WP Super Cache?

    That section isn’t used for normal speedup of all pages, and doesn’t matter for the purposes being discussed here. You can just ignore it.

    >Also I have a small problem, maybe you could help, when I first fetch a page in google wm tools it is
    >showing ‘Temporarily unreachable’ but when I fetch it a minute later it shows as ‘complete’ Do you
    >think that the ‘Temporarily unreachable’ error is related to cashing plugin ?

    We haven’t heard of this before. If you’re one of our customers, please open a ticket with us using the “Contact” link above and we’ll try to help.

  23. Thanks a lot for your reply. I have disabled ‘preload’ and it appears that my pages are loading faster and the ‘Temporarily unreachable’ error is gone.