WP Super Cache 0.8.9

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

This version fixes a number of bugs and adds two new features, but in case you run into problems upgrading, make sure you delete wp-content/advanced-cache.php before copying plugins/wp-super-cache/advanced-cache.php over it. Go on, read that again. Delete that file. Jonathan Dingman didn’t and when he copied the file over the symlink he overwrote wp-super-cache/wp-cache-phase1.php. His site went belly up and he started screaming for my head!!! Err no, he appeared on asking why it didn’t work. Thanks Jonathan for working through the problem with me. My fault for not making the instructions clearer!

If this happens to you, take a deep breath and unzip the plugin again in the plugins folder and delete wp-content/advanced-cache.php

Anyway, the new features are:

  1. Cache rebuild. Serve a static cache file to anonymous users while that file is being generated.
  2. Disable the large global lock that makes every access to the cache atomic.

Besides those, I got rid of the symlinked file in wp-content/, and the plugin now copies a file called “advanced-cache.php” from the plugin directory to simplify things. Especially on operating systems where symlink isn’t available. Yes, that’s Windows.

If your site is horrendously busy and you get a ton of comments every day and you’re too broke to buy a new server, then the cache rebuild feature will help you a lot. You should see the load on your server go way down if you enable this. Anonymous users who visit a page where a comment has just been left will be served a static cache file from the supercache instead of all the requests trying to generate a brand new page. The page served to them might be a few seconds out of date but that trade off is worth it.
Here’s the original thread that inspired the idea. Thanks Tigertech for writing the patch and for sharing the performance graphs. Check out the load on his server, before and after the rebuild function was switch on:

wp super cache load graph

If you’ve had problems with deleting the cache on your blog it *might* be because of file locks. Some hosts just have problems with them. The file locking in the plugin is very coarse. When the plugin wants to do any sort of write operation it grabs a lock, does the writes (which could include clearing expired files, or creating wp-cache and supercache cache files), and then releases the lock.
Any other process running the plugin that tries that won’t get a lock: new cache files won’t be created, and cache files won’t be cleared.
It isn’t a huge problem that the lock is so coarse because the writes don’t take very long (the lock is enabled after the page is generated), but some very busy sites take quite a while to clear their cache files.
On the downside, disabling the file lock won’t stop multiple cached files being generated simultaneously (great), but it also won’t stop multiple “clear cache” attempts either (boo!)
From what I recall of looking at the other cache plugins for WordPress, most of them don’t have any file locking and seem to do just fine.

I almost forgot! There is also a new debug mode. Edit wp-content/wp-cache-config.php and look for “$wp_cache_debug” and follow the instructions. It will send you a few emails when things don’t go right and may help track down any problems.

As a final note, I would like to sincerely thank Robert Wolf who spruced up the admin page and gave it a nice lick of paint and Michael Torbert for helping me debug the plugin a while back.

53 thoughts on “WP Super Cache 0.8.9

  1. Hey just a quick query since the last version with it turned on I have been getting errors accessing my site.

    ‘The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression.’

    Is shown in firefox, and IE does not open the page either. Any help appreciated

  2. The “advanced-cache.php” tripped me for a minute but once I realized I had to copy the file from the plugin myself (about a 1 minute), I was back in busy.

    I got more traffic than your Tigerman example, so I am trying the rebuild thing. Doesn’t seem to be breaking anything so I will give it a test drive.

    Thanks this plugin. Its makes running an active blog easier. 😉

  3. Many, many thanks for your work and sharing!
    Its people like you who make WP such a lovely software to use.
    Please keep it up.

  4. The auto-update did not work for me. After reading your post, I went and deactivated, deleted the plugin then went through Filezilla to delete the advanced-cache.php folder and it would not let me… strange. So I just renamed it and thinks are working great now.

    Thanks for everything. 🙂 Gilbert

  5. The plugin will automatically handle “advanced-cache.php” for you, but only if your “wp-content” folder is writable. I made it writable for a moment (and then made it not again) and the plugin took care of it just fine after visiting the settings page.

    Nice work, Donncha. 🙂

  6. I deactivated the plugin, upgraded it through WordPress, then activated it – and it seems to work fine.

  7. I wonder if I should do a minor point release because of the incomplete documentation? I’m glad to see not everyone was hit by the symlink problem!

  8. I really appreciate your work on this really really great plugin, it helped me a lot not paying lots of money for the dedicated servers two times.

  9. The admin page seems a lot quicker! Great work

    Maybe an for the next version; a button which rebuilds the cache for anon. users // or the cron does it

  10. Ramoonus – there’s a plugin that does that but I wouldn’t recommend using it. Having lots of cache pages around eats up space and makes checking for expired pages slower.

    It also makes disk recovery much slower if there’s a problem on the server. Basically, fsck takes a *lot* longer. It’s a real problem for hosting companies.

  11. Now, here’s my question – I no longer have the option of turning gzip on or off, and I don’t have a admin panel section for .htaccess (the permissions are set to change htaccess on its own, but the section is just gone, but the whole panel seems to be working).

    Has the plugin changed so much since the last iteration?

  12. umm… I can’t find wp-content/advanced-cache.php is this always there or is it only created for advanced features? I’ve looked in wp-contents as well as my plugins folder but can’t find it anywhere?!

  13. @Donncha If that is the case, what is the ideal number of files to have in cache? I have heard people (and you) talk about not wanting too many because it can slow things down but, setting the expire time to soon will result in no real benefit. So, ideally, how many files should be in cache? That is, at what point does the server begin to choke because there are too many files to search through.

  14. Can’t get the plugin to work for MU wordpress? I copied the wp-cache put the directory and single file into mu plugins, upload to server. The htaccess has the info needed. I click on super cache under siteAdmin and it takes me to the page. I click to enable supercache and wp cache and the whole site goes down…


  15. Sirius – that’s a “how long is a piece of string” type question. There’s no correct answer and it depends on your server. Set the expire time to an hour, and if deleting expired files takes too long, change it to 30 minutes, then 10, etc.

    Babak – don’t worry about it. It only exists if you already have wp-super-cache or another caching plugin installed.

    Techseaport – it’s there alright. Not sure why you can’t see it.

  16. @Donncha Ok then… how long is “too long” when you talk about deleting? I am guessing that the majority of super-cache users do not have a dedicated box and therefore can not see the strain which is put on the server.

    I guess my question stands because there is no way for a shared hosting user to know what to set their settings to. Maybe we could time the processes and note them in the admin console? If we did, we could guide people into correctly changing their settings.

  17. R – check your error log, and also make sure the wp-cache-phase1.php wasn’t overwritten because of the symlink.

    Sirius – I don’t know. Set it to an hour. It’s impossible for me to say. Even an expiry of 60 seconds will help your site, but if there are thousands of cache files I’d suggest reducing the expiry time.

  18. I don’t show errors. And I uploaded wp-cache-phase1.php over the existing file if I understand you correctly–to check what you said.

    Whenever, I delete advanced-cache.php I can see the dashboard again. Has anyone got this working with mu??? What can I do?

  19. So, my idea for a timer to check how long the deleting process is was a bad one? I figure you could have it in the debug email and send it via email if that process took too long. At least then people would have an idea of where they stand… wether their server can handle 100 files or 1k files.

  20. R – edit the advanced-cache.php and change the file so it tries to load “mu-plugins/wp-super-cache/”… rather than the directories that are there. It just occured to me that it’s trying to load a non existant file in plugins/wp-super-cache/. I’ll get it fixed eventually.

    Sirius – I didn’t realise you were suggesting a timer check. You could simply try deleting the cache from the backend and timing it manually too. If it takes more than 5 or 10 seconds that’s too long IMO.

  21. Wish I could get it to work, but it has the same problem. I delete the advanced advanced-cache.php file and my website comes back up. Hopefully, it will work out for me pretty soon.
    I copy the wp-cache.php to the mu-plugins folder and upload both and I go to check the top radio button and update and lose the whole website? I wish I knew what I was doing wrong?

  22. I didn’t see what you said in the post above. I didn’t really understand what you meant by editing the advanced file, so I just threw a McGiver and deleted everything from the advanced file and left only the below between the PHP tags:
    # WP SUPER CACHE 0.8.9

    And ha! it seems to work?!?! I know nothing about this stuff 🙂 So let me know if I am just crazy, and I deleted the wrong stuff…

  23. R – you just disabled the plugin. It’s not serving cached files now!

    The dev version also includes some new code to cut the number cached files by half if you have lots of anonymous users. 🙂

  24. Donncha, yes I have it installed, I’m upgrading, or trying to! I turned the it off and then deactivated it, then I went to install the new version when I read your instructions. That’s when I went in search of that file. Couldn’t find it, so I posted that message. Thanks.

  25. I tried 8.9, what should I add back in advanced-cache.php to get it to work? And so that the site doesn’t dissapear? Thanks

  26. I’ve got the same problems as R in WPMU. I just get a blank screen with nothing in the error logs. That’s with 8.9.

    It seems to work fine on WP once I got over a couple of file issues (like removing the old links)

  27. My sites has 1,083 posts and 123 users, is it need WP super cache plugin to speed up the performance ? When a blog require WP super cache plugin ?

  28. My single-user WP sites have been running great with this release. I’m using both experimental features with no problem.

    I still have lockdown enabled though. For some reason when we moderate like 50+ comments the load on the server shoots sky high. But this is no biggie, I just manually delete expired files every 3 hours or so.

    Thanks for all your work on this plugin.

  29. Wow, thank you for this post! You just saved me from the blank pages issue 🙂 Was driving me crazy trying to isolate the issue — turned out was that simple symlink. Oops.

  30. I tried a variation of all setting, and I’m still having no luck with clearning of expired files, they just build up lol and I see like 15k of expired files at time. Forcing me to delete the entire cache folder (site down time around 5 minutes) every 10 hours or so :(. Thanks for trying.

  31. lol this is why I usually wait for several days whenever a new update is released. Just in case things get messed up and everything ^^

    Can’t live without this wonderful plug-in! Good job Donncha

  32. Hi team,
    i have the problem in my plugin 0.8.8

    “mod_expires – Set the expiry date on supercached pages”

    this is the mod_expires in my .htaccess

    ExpiresActive on
    ExpiresDefault “now”
    ExpiresByType text/html “now”
    ExpiresByType text/xml “now”
    ExpiresByType text/css “access plus 30 days”
    ExpiresByType text/plain “access plus 8 hours”
    ExpiresByType application/x-javascript “access plus 30 days”
    ExpiresByType application/x-shockwave-flash “access plus 30 days”
    ExpiresByType application/pdf “access plus 30 days”
    ExpiresByType image/gif “access plus 30 days”
    ExpiresByType image/png “access plus 30 days”
    ExpiresByType image/jpeg “access plus 30 days”
    ExpiresByType image/x-icon “access plus 30 days”
    ExpiresByType video/x-flv “access plus 8 hours”
    ExpiresByType video/quicktime “access plus 8 hours”

    sorry for my english.
    have a good work

  33. Thanks for the reply on this (http://wordpress.org/support/topic/239767?replies=5) support forum donncha. For some reason, my reply to your post is not appearing there. Anyway, here’s what I said

    Ok. I have enabled it. I’ll be back on this post to report weather I survived a DIGG like effect of traffic on that day. I am expecting at least 600-800k pageviews or even more.

    I already fine tuned my server, added additional 256 MB of RAM, installed APC etc etc. It’s just the directly cached pages that’s bugging me for a while. By the way, would you know why it would show Index of/?

  34. Hey Donace I’m having the exact same content loading error problem with wp-supercache. if the cache is on or half on it throws that error, and if it’s off everything works fine. You or anyone have any ideas?

  35. I just installed WP Super Cache. Getting following warning in settings

    Warning! /home/xxxxx/public_html/ is writable. Please make it readonly after your page is generated as this is a security risk.

    Please advice

  36. I am receiving the same warning as the poster above and all searches have provided no solution. Why do I get the warning under Directly Cached Files (“x” replaces actual path names)…

    “Warning! /homepages/x/xxxxxxxxxx/htdocs/home/ is writable. Please make it readonly after your page is generated as this is a security risk.”

    I am a WordPress newbie, so I have no idea what needs to be done here to correct the problem.

Leave a Reply

%d bloggers like this:

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.