WP Super Cache 0.9.1

WP Super Cache version 0.9.1 is now available. WP Super Cache is a page caching plugin for WordPress that will significantly speed up your website.

Major changes under the hood in this release, and many bugfixes:

  • If your blog is installed in a folder then compare the mod_rewrite rules in your .htaccess with those on the admin page. I fixed a bug in how those are generated.
  • Out goes the shutdown function the plugin relied on for years (going back to the days of wp-cache), and in comes plain old output buffering on it’s own.
  • If you’ve had problems clearing the cache on your blog it could be because wp-cron isn’t firing. I’ve added checks for that. Joost helped me debug that and he blogged about it too. You’ll get a nice warning message if those checks fail.
  • If after all that, your cache still doesn’t clear, add $wp_cache_shutdown_gc = 1; to wp-content/wp-cache-config.php to clear the cache at the end of pageload instead of by wp-cron. It will slow down page generation for a tiny number of your users though.
  • The Last and Next garbage collection times are now in the timezone selected for your blog.
  • Added an admin notice on the plugin page to warn that caching has to be enabled. A warning is shown below the plugin activation row too.
  • If your site runs on a Windows server, I fixed a small problem with slashes and creating the config file.
  • The plugin created empty supercache folders, but that’s fixed now.
  • Bad Behaviour support seems to work nicely now!
  • You can now relocate the supercache plugins folder. See $wp_cache_plugins_dir in wp-cache-config-sample.php.
  • I added 2 new filters: wp_cache_served_cache_file in wp-cache-phase1.php (BB uses this) and wp_cache_file_contents in wp-cache-phase2.php where you can filter the contents of the newly created cache before it’s written out to a file.
  • The readme.txt has been updated too warning about using NFS to store the cache folder, solving wp-cron problems, added the list of Apache modules required for expired pages to really expire in the browser cache.

I also added a donation link in the readme.txt and on the admin page. You can hide it with the click of a button but if you’re feeling generous, I’d appreciate a donation.
I don’t expect many donations, that’s how these things work, but if you tell me your site does 100,000 page views a day and you couldn’t live without caching I might be slightly annoyed if you come looking for free support.

PS. Looks like Bad Behavior support is broken because the docs on the BB site were a little misleading and I don’t use the plugin. Grab badbehaviour.php and copy into plugins/wp-super-cache/plugins/ overwriting the file of the same name in that folder.


You might also like

If you like this post then please subscribe to my full RSS feed. You can also click here to subscribe by email. There are also my fabulous photos to explore too!

67 thoughts on “WP Super Cache 0.9.1


  1. Great to see these regular updates still coming! Whilst I’m lucky to see even two digit page views most days, this plugin does help keep the server admins from breathing down my neck.


  2. nice… I’ll install it tonight, does it play nice with domain mapping? I’ve hacked my current install of domain mapping kinda work with domain mapping and wp super cache


  3. I haven’t been able to use Bad Behaviour in ages :-\ I don’t know if it’s my web host or something else, but it always slows down DB calls dramatically, so while browsing is fine, posting a blog entry, commenting, or creating/deleting a category can each take multiple minutes to go through.

    Might try it again, but I still wonder if it’s something weird with my web host.


  4. Thanks, I actually tried to install 0.9 yesterday and it shut down my site (http://2thumbgunslinga.com) after I turned in on. Just got blank screens then when I manually deleted it I couldn’t talk to any of my databases, wierd.

    I had to work with my tech support to get it back up. I think its because I’m hosted on a Windows Server. I’d like to try again since you mention in this update you worked on fixes those hosted on Windows Servers. Is there any “Windows Server” specific tweaks I should do before I try this again?

    Thanks again, I see how fast your site and those that use this plugin load so I really want to make this work. Great work!


    1. That’s probably the bug that was fixed. A path in the config file was messed up because of the backslashes Windows used. This version should work a whole lot better!


  5. Great plugin Donncha! Sent you a donation. :)

    Please excuse if I’m a bit dense here, but are the expired files on my admin page for WP SC the files that need to be cleared? Mine aren’t clearing on their own so is the best method adding the shutdown code (that you mentioned above) or should I try to get the WP cron to work?

    If WP cron, how can I get that working correctly?

    Thanks again!


    1. Thanks Kenneth! It’s ok to have some expired files but if they don’t clear when the wp-cron is supposed to fire (at most every 30 minutes depending on your settings) then there might be a problem.
      Did you get any warnings about wp-cron not working? Look at the Troubleshooting section of the readme.txt. It has a few suggestions for fixing things.


  6. First off, love the plugin.

    Secondly, I have been able to use WP Super Cache without any conflicts with other plugins until recently. There is a plugin called “Edit Comments XT” which allows a commenter to edit their comment for a short period of time. Unfortunately, when a user edits the comment, the old cached page is still served and the comment is not updated.

    Is this a issue for the “Edit Comment XT” author or is it a current limitation with WP Super Cache? If it’s not a Super Cache problem, is their a way to edit the comment plugin to force a new cached page?

    Thanks for your time and commitment in building such a great plugin Donncha!


    1. That plugin should probably execute the “edit_comment” action when a comment is edited and saved. ie: do_action( ‘edit_comment’ );
      This should only be necessary if the plugin interacts with the database directly though. Otherwise, the action should be called normally and the cache for that page refreshed.


      1. Interesting, I am not sure the plugin executes the edit_comment action, but I am pretty sure it does access the DB directly. I’ll pass that info along to the plugin author and hopefully he will be as responsive as you have been.

        Thanks for looking into that for me Donncha. I’ll be sure to send a donation your way when I receive my next Adsense payout!


  7. No, there haven’t been any warnings. I’ll look at the troubleshoot section and try some things there and let you know. :)

    Thanks!


  8. I can’t get wp-cron to delete the garbadge so is there a way I can actually setup an real cronjob through the control panel? If so what would it be. If someone answers, i will just copy the text and paste it in my cron. Thanks :)


    1. djslim – you could cron the delete command:
      rm -fr /path/to/my/cache/dir/*

      But make 200% sure you get the right directory as that’s a pretty powerful command!


      1. awesome. just sent it to my host so they could setup the cron. i use hsphere on my managed dedicated server and have no clue how to setup crons but they have done it before for me :)

        Thank you


  9. great, thanks for the updates! my host has even complimented me on using wp-supercache! it really keeps server load down.


  10. Is it just me, or is the calls for Bad Behavior not correct. It says “Warning! Bad Behaviour not found. Please check your install.”

    But it is installed and working, might be because behaviour is spelled wrong?

    It says Behaviour needs to be here
    /wp-content/plugins/Bad-Behaviour/

    But the actual default install directory for BB is BEHAVIOR, in other words dropping the U

    Am I way off here?


    1. I wish it was that simple. It prints the non-US spelling of behaviour but the plugin checks for “behavior”. Hopefully have that fixed shortly.


  11. Yep that did it, working like a charm, although I was not really having issues before. I just wanted to check out to see if I was missing any seconds the way I had it.

    If my BB was working before with FULL ON, is it better to leave it that way? Load-times monitoring w/ Firebug seem the same either way I have it.


    1. I’d say that half-on is better because BB needs to execute and possibly refresh keys or something. With static files you might not be protected from the bad guys.


    1. I enabled debugging and it am receiving emails saying “Cache Expiry cron job failed. Probably mutex locked” which I have never received prior to this build. I tried to do the steps in the readme file(changed sem_id, uncommented out use_flock, checked that the permissions on the mutex lock file were 644, etc) but have had no luck so far. Any ideas?


        1. Browser caching thing is a 304 header which wp-super-cache doesn’t support, so I’m not sure why your blog shows it supports caching. Mine does too, so I need to talk to Alex and ask him about that. I’m surprised reverting to 0.9 changed that caching statement.

          You could try disabling file locking. There’s hardly any need for it any more anyway since writes are done to temporary files now before renaming to the correct filename.


    2. There are two different types of caching going on. WP Super Cache is server-side caching only – it saves your server from having to re-generate the page every time. ismyblogworking.com also checks for client-side (browser) caching via 304 Not Modified support – which saves your web browser from having to re-download the same content multiple times when reloading or navigating around a site).

      I changed the messages on imbw to clarify this a little.

      NB, browser caching/304 support is not always a significant benefit – it depends on the traffic patterns on your site.


  12. well it was working great. now all of a sudden caching isn’t working at all and nothing on my end changed. the settings menu for wp-cache shows pages being cached, ismyblogworking shows as well but viewing source, every single page show a dynamic load.

    tried installing again and even going back a version with nothing.

    idolloglive.com is my URL


  13. It has problem with comments. After I approve the comment, it does not appear on page unless I clear the cache. Any help.


  14. Hi, it seems like in IE-6 only. It’s giving characters for spaces. Â is the character, it also messes up the quotations.

    am I installing it wrong?


    1. What character encoding do you use on your blog? UTF-8? Do you see the strange characters on super-cached pages as well as pages logged in users see?


        1. I don’t know why you’re seeing that error. I don’t have access to IE to test it.

          If you can, download a few cached files directly off your server using an ftp client and examine the page source code to determine the character code that is replacing the space character.

          If you completely disable the plugin and clear the cache, do the weird characters still appear?


          1. no they go away. I think it’s just when it cache’s it, something’s not compatible with ie6. i wouldnt bother you with the issue, but it seems that 25-30% of our users use ie6.

            If I sent you the code would you know what to look for? because i do more front end design and simple html so i wouldn’t have an idea.

            i take it none of your other users have this problem?


  15. Adi – occasionally people report strange problems with characters but I don’t recall how it was fixed. Yes, send me the file and I’ll take a look. Email is donncha AT ocaoimh.ie


  16. I’m not sure if this is a recommended solution, but after a bit of searching I found this post from the authors of wptouch regarding making wp-super-cache play nice with mobile.

    We’d really like to be running wp-super-cache in full-on mode, so I tried their suggestion of plugging a line into .htaccess to detect iPhones and ipod touches with great results.

    Here’s the .htaccess line – it needs to be added in 2 places, please see the link for their recommended placement.

    RewriteCond %{HTTP_USER_AGENT} !^.+iPhone

    I can confirm that this is working with the iWphone plugin and wp-super-cache on wpmu. I’m seeing super-cached files in my browser, and properly formatted files on my iphone.

    Btw, Thanks Donncha for the great plugin!


  17. Hi, great plugin!

    I am having some problems when the plugin deletes the cache files since it does so at the time when my weblog is having many visits. So my server crashes as it attemps to re-new the cache files. I was wondering if there is some way to make this process happen only at nights or when the visits are low?

    Thanks a lot, I hope my question is reasonable…

    And sorry for the english, its not my language :P

    Thanks!


  18. I’m a little weary of this plugin. Does it play nice with other plugins? Are there any plugins I should avoid while using this?


  19. Bill – it plays nicely with most other plugins but sometimes updates don’t happen immediately because the other plugin expects to execute PHP on every request. The solution is to use AJAX to update dynamic parts of the page.


  20. I have tried setting it to 60 sec but the problems seems to be that only the wp-super-cache is cleared, expired wp-super-cache pages and normal wp-cache/expired cache remain untouched.

    Any idea why this is happening? appreciate the help.


  21. Hi
    SUPER plugin. I gladly sacrificed Bad Behavior when I saw the increase in speed.
    Your latest version even worked with Laziest Gallery.

    Checking on browser shots, though, the pages didn’t work in IE6

    Would it be possible to add some very basic browser detection so that I could serve non-cached pages to IE6?

    Thanks again for a super plugin!!


    1. Unfortunately it doesn’t happen for everyone – I tried this blog and inphotos.org in browsershots.org and both worked ok.

      inphotos.org didn’t work in IE6 with the plugin on or off, but ocaoimh.ie did work. It didn’t work in IE5.5 with the plugin on, but that’s a horribly old browser and I don’t have time to debug issues with that.


      1. Thanks!
        If I knew enough Apache, I could probably intercept IE6 in the .htaccess file and avoid the cache. Having the cache work for newer browsers is far preferable to no cache.
        I will dig around and see what I can find.


  22. How to use this plugin if .htaccess contains a redirect command from .html to no .html?

    For example, xyz.com/test.html will be redirect to xyz.com/test/.


  23. Hey Donncha,

    The plugin doesn’t seem to be respecting the Lock Down setting. I have the new cache rebuild and file settings disabled. Nothing I can do seems to help.

    any idea?


      1. I have just configured and seems to be working – the rewrite rules go to web.config and cache pages are being created. Not tested yet whether the options work.


    1. Follow up question – number of cached pages appear under WP-Cache and none under WP-Super-Cache.

      Is this normal under default initial setup ?


  24. Please remove my email from subscription to this comment list. I clicked on the manage your subscriptions link and it took me to a separate set of blog postings with no method for subscription management.

    Thanks for the great plug in!!


  25. Hi, because our site used up all our CPU Limit, we installed WP-Super-Cache on WP. However when I checked our site on http://ismyblogworking.com/chicklitreviews.com it says:
    # Your blog application doesn’t support gzip compression.
    # Your blog doesn’t support client caching (no 304 response to If-modified-since).
    # Your feed doesn’t support caching (no 304 response to If-modified-since)

    Does that mean the caching isn’t working? If it isn’t working, what can we do to make it work? If we keep going over our CPU limit (5.5%) we’ll be banned from our hosting account.

    Hope you can help!
    Leah


      1. So our site isn’t cacheable? Could that be to do with the theme? I made it in Artisteer so don’t know how good a theme it is. Would modifying our theme also lessen our CPU load??


        1. I just checked your site and the cache timestamp changed each time I reloaded the page which probably means a problem with your .htaccess rules. You should probably run the plugin in “half-on” mode. That’s only a small bit slower.


          1. Have done that, it’s now half-on. Hope it fixes it?

            Thanks for your help, here’s hoping our CPU % stays down!


  26. For those that are wondering why the recent updates of WP-SC stopped clearing expired pages, for me, it was upgrading past WP 2.7. I just upgraded to 2.8.6, and it works perfectly with Cache and Super Cache enabled.

Leave a Reply

Loading Facebook Comments ...