It’s time to lift the veil of secrecy on my latest project. With help from friends who diligently tested and reported bugs on this I can now present version 0.1 of WP Super Cache!
It is an extensive modification of the famous WP-Cache 2 plugin by Ricardo Galli Granada. This plugin creates static html files that are served directly by the webserver as well as the usual WP-Cache data files. It also goes one step further fixing a couple of bugs, adding some hooks and new features and making WP-Cache more flexible.
From the plugin page, here are some of the major changes and updates:
- A plugin and hooks system. A common complaint with WP Cache was that hacking was required to make it work nicely with other plugins. Now you can take advantage of the simple plugin system built in to change how or when pages are cached. Use
do_cacheaction()andadd_cacheaction()like you would with WordPress hooks. Plugins can add their own options to the admin page too. - Works well with WordPress MU in VHOST or non-VHOST configuration. Each blog’s cache files are identified to improve performance.
- Normal WP-Cache files are now split in two. Meta files go in their own directory making it much faster to scan and update the cache.
- Includes this WP-Cache and protected posts fix.
- Automatically disable gzip compression in WordPress instead of dying.
- As Akismet and other spam fighting tools have improved, the cache will only be invalidated if a comment is definitely not spam.
If your server is struggling to cope with the traffic your site gets this plugin could be just right for you. If your site regularly gets hit by spikes of traffic like a digging or slashdotting it’s definitely the right choice, and even for everyday use, you may very well notice your webserver is a little bit more responsive.
I contacted Ricardo last week and sent him on an earlier copy of the plugin but I haven’t heard from him yet however. I’d love to know what he thinks of my modifications!
Update! this post has been dugg, please digg it and we can really test the cache out!
Nov 6th: WP Super Cache 0.2 is out! I think all the bugs mentioned below are now fixed. I applied Tummbler’s patch (from Elliott and Reiner) that enables gzip compression of the WP-Cache data files and fixes feed content types.
Please note: PHP’s internal zlib compression must be disabled for this to work. Look in your php.ini for the zlib.output_compression and zlib.output_compression_level directives and comment them out by placing a “;” at the start of each line.
Check the plugin page above for the download link.
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 and funny videos to explore too!

Well done! If i got it right, this is a fork of WP-Cache 2, improved in many ways. There is a hack around to enable gzip with WP-Cache 2 which IMHO helps but i’m reading that Super Cache “Automatically disable gzip compression in WordPress instead of dying”. Why is that?
Im not providing the hack link just in case Akismet thinks im spamming
Wow! This sounds very interesting. I’ll be back when I’ve more traffic
Hello Donncha,
Wow, this is awesome news! I am excited and a bit annoyed at the same time because just two days ago, I released a modified WP-Cache v2.1.2 on my brand new blog to enable caching and gzip to work together sensibly: instead of recompressing cached pages for every request with PHP or mod_gzip/deflate, compress once per page and save to disk. Now I’m going to ditch my work and try out your WordPress Super Cache, which is simply superior.
Expect a pingback soon.
/runs off to try this new toy
I never could use WP-CACHE properly because my site is hosted on a Windows/IIS server rather than an Linux setup. As far as I can recall it was to do with the need for symbolic links in the install process and various other nasty bits that just don’t work under Windows in the same way
Will your Super Cache work on a Windows/IIS environment?
You still can’t use gzip compression with the regular wp-cache even in this plugin, but the super cache part of it creates index.html.gz files that will be served directly to the browser.
Unfortunately I had to have that disabled by default because some servers didn’t deliver the pages with the right content-type. My servers run Debian and that’s fine, but a Cent OS server barfed on it. Comparing /etc/mime.types on both I see the Cent OS one has entries for gzip which the Debian file warns shouldn’t be there ..
tummblr – I’d love to see your code! Would you mind emailing it to me?
coyote – sorry, I don’t know if it will work or not. I expect it will as long as you copy wp-cache-phase1.php to wp-content/advanced-cache.php
Donncha – You can find the modified files and the diff files here:
http://www.tummblr.com/wordpress/wp-cache-gzip-without-excessive-cpu-overhead-yay/
Most of the credit goes to Nick Georgakis and Reiner Saddey as cited in the post; I just cleaned up and merged the changes to the latest WP-Cache and added an admin option.
The modification gzips and stores pages to disk so that future requests get the already compressed page on disk rather than an on-the-fly recompression (which is the result of most WP-Cache+gzip hacks/fixes on the blogosphere). But it still requires some PHP processing per page, one of the weaknesses of WP-Cache like you talked about. Your solution completely eliminates any PHP CPU crunching, so it’s superior IMO. Cache+gzip with your WP Super Cache should work fine too as long as we figure out the proper web server configs and/or .htaccess settings.
will give it a try this weekend and compare load averages then, thanks doncha!
I just removed WP-Cache and installed WP Super Cache with gzip compression enabled and all seems to be in order. Pages are loading faster than ever!
You seemed to have fixed/changed(?) an annoying behavior of WP-Cache’s: since by default WP-Cache is set to not cache pages with “wp-” in the URL, it also refused to cache my blog post that had “WP-Cache” in the title and thus the URL. WP Super Cache is caching that page happily.
Sounds great – any special instruction for wpmu?
Okay – I have seen it in the readme file, thanks.
I’m giving it a go on my site. Good work, Donncha!
A few notes:
It looks like your readme.txt has a UTF BOM, which is preventing the WP plugin page from displaying it as usual.
When I first activated it, I also tried to enable gzip at the same time, and got an error about the prune_super_cache() function being undefined. Turning it off and on after that point did not re-display the error.
The installation instructions say to remove the WP_CACHE define. But it’s required, and the FAQ says you need it.
Feeds get served up as ‘text/html’, and not with their correct content types.
When you disable compression, you get a message about disabling a subset of the rewrite runes in your .htaccess. But with the rules listed in the readme, it doesn’t appear to be necessary to remove them. The rules stated in the readme should be fine (with the caveat about running WP out of a subdirectory requiring rule modification)
I dont think that i need it at this moment. Anyway great work
Keep it up.
Pingback: WP Super Cache: truly sensible caching with compressed and static pages | Tummblr
Pingback: incorporated subversion - education, media, community » Blog Archive » WordPress Super Cache is MASSIVE
I would love to try this, but since my blogs are hosted on Windows/IIS, I’m pretty sure it won’t work. Anything that depends on rewrite rules won’t work on IIS unless you install a 3rd-party app (don’t remember the name at the moment, but it’s an add-on you can buy). IIS requires that index.php be part of the URL without the add-on.
If you ever get a chance to work out the issues on IIS, I’d love to try it.
Thanks,
David
I have a stupid question, what does fancy permalinks mean? It was the first line in the installations section of the README file.
My permalinks options looks like this – http://www.mysite.com/archives/123 The installation says, You must have fancy permalinks enabled for this to work.
Dougal – thanks for the great report.
WRT feeds I can do two things, either not cache them (boo!) or add an “addContentType” or similar declaration to a .htaccess files that may fix it.
Donncha, Dougal – I think the bug where feeds are served as “text/html” is from WP-Cache. Reiner Saddey has a fix here that involves adding 1 line, “flush();”.
http://blog.saddey.net/2007/02/18/how-to-prevent-wpcache-from-changing-a-feeds-content-type-to-text-html/
Any improvements on the “keeping parts dynamic” side ? I’m not sure I understand the purpose of do_cacheaction() and add_cacheaction().
Installed and working like a champ. I have had the odd one or tow times that I got dugged and it killed my site – hope the next one comes soon to try this snazzy piece of code out!
Pingback: Tummblr
Hi, I just installed your plugin, but I’m not sure if it’s working or not. It installed fine and I enabled it, but it just says 0 cached files for both WP-Cache and WP-Super-Cache! So not sure what’s up with that?? I’m guessing it’s not caching since it has 0.
Any ideas on how to fix this? I’m running WordPress 2.3.1 and I uninstalled WP-Cache and deleted all the files.
Thanks
Hello again. I merged in code to make WP-Cache serve up gzipped cached pages to logged in users. The cached pages are only gzipped once per page and stored on disk, not recompressed on-the-fly per request. This way both anonymous and logged in users can enjoy gzipped pages. Good idea, bad idea?
Modifications here:
http://www.tummblr.com/wordpress/improving-wp-super-cache-gzip-for-logged-in-users/
Hi,
I’m really interested in this plugin since my shared server can’t handle so much database queries at the same time. For example, only my front page is about 50 queries.
Now here comes the stupid question. With this plugin, will it reduce the queries? I suppuose so, but how much aprox?
Thanks in advance.
I am running WP 2.3.1 … I get:
Fatal error: Call to undefined function: do_cacheaction() in /home/17740/domains/scottjanousek.com/html/blog/wp-content/plugins/wp-super-cache/wp-cache.php on line 171
Not sure where this function is supposed to live. I tried searching for it … but couldn’t find it.
Sweet! I’m excited.
tried it.
Canned it and went back to WP-Cache.
Why?
When I enabled super-Cache, the little images on my Template, stopped loading properly.
so, I went back and everything is fine.
Sorry.
-Chuck
I also got the same error as Scott Janosuek
Donncha-
This is sooo exciting! I have contemplated programming a new WP-Cache for quite some time, but I’m not good enough at PHP. This is exactly what I’ve been waiting for.. Thank You!
See my wp-cache hack, maybe some good ideas about what http headers to send.
My host changed their system setup (re permissions) during a security upgrade (don’t ask me what exactly) after that wp-cache stopped working altogether. Going to give super cache a try…
…will report back
db
The zip file has been updated (even if the page says 0.1) and I have fixed most or all of the bugs above.
I applied Tummbler’s patch and yes, it works beautifully:
1. If compression is enabled, then logged in users see compressed WP-Cache pages now.
2. I disabled super caching of feeds and WP Cache should return the right content type.
The “function not found” errors Dougal found should be gone now.
Fixed a small bug stopped WP-Cache creating new files when the Super Cache was disabled.
You can also get the newest code from http://svn.wp-plugins.org/wp-super-cache/trunk if you’re familiar with SVN.
This sounds as a great plugin, but I am wondering if I can use it on my website.
My chess Teaching website has some posts (with mate in 1, mate in 2, mate in 3 and other exercises) that are supposed to be different each time a user visits the site. The other posts can be cached.
Is it possible to exclude caching for some of the posts?
Chess teacher – you’d have to write a plugin, but yes, you could exclude a few posts from the super cache.
Hi,
i`ve changed from wp-cache to your super-cache plugin and it works really great! Thank you for your fantastic plugin. Why don`t you just change the version tag in csv?
What about mfunc? Like wp-cache? Or dynamic adsense code.. how can i make it? (and semmelstatz to work with referres..?
Have a nice day
sara
OK, a couple of glitches for me.
I downloaded the 0.2 zip, but it still reports as 0.1 in the plugin file so I’m not 100% certain I’ve got the latest.
When I activate it, it works great apart from pages for form submissions where it actually shows/breaks the form action, instead of hiding it behind the buttons IYSWIM (look at the form at the bottom of http://bytor.co.uk/faq and you’ll see bits of the action listed above and below the form boxes/button.
Finally, in the “rejected URIs” box, I’ve put some entries, but it ignores them and caches matching pages anyway. I put in “/faq” then changed it to “faq” and it still caches the page http://bytor.co.uk/faq but never supercache, only wp-cache according to the comment line in the source.
Or am I misinterpreting stuff?
Sara – look at the plugins/searchengine.php as an example of how to make the cache less efficient and make it target referrers. Unfortunately plugins that rely on php code being executed on every request won’t work correctly, but you can always disable the super cache part of the plugin, leaving regular wp-cache.
Graeme – the first bugs are strange. The cache shouldn’t affect your comment form. What plugin is that? I added a check for .php to the rejected URIs which is why your faq was still cached. Otherwise “wp-” matched stories and pages starting with “wp-”. That needs to be more sophisticated.
Very Nice.
I checked through ALL the forms and it does only seem to be the FAQ which is affected. The plugin for that is FAQ-Tastic http://knowledgeconstructs.com/wordpress-plugins/faq-tastic/
If you could get the rejects to work that would be great. Even something like a wildcard or symbol put at the start of it so it would grab every version of that URI would solve it. So perhaps putting each URI as “*/faq” if you want it to work on every version and just “/faq” to do the conservative version you already have? That logical?
any plans on this some how working without fancy permalinks?
donnie – it will probably work, but you’ll need mod_rewrite to get the super cache static file serving working. Give it a go and see!
Ok I gave it a shot. When I enabled compression, I started to 403. No clue why, but that was the end result. Disabling fixed it. Reverted to the old wp-cache for the moment.
Hey Donncha, awesome work!
Any idea if this requires Linux (like WP-Cache2 did/does) or if it’ll work anywhere PHP runs (like Matt’s original Statictize plugin)?
(Assuming an environment with PHP, MySQL, mod_rewrite, and write access to local folders)
CG – it uses the same symlink code that WP-Cache uses so it might cause a problem for Windows boxes. It shouldn’t be much of a problem checking that we’re running on a Windows box and copying the wp-cache-phase1.php file instead of symlinking it.
I don’t have a Windows box handy to test it though.
PS. I *love* your xcache plugin. When not serving static files, this server hums along nicely with it.
Pingback: Beat my WordPress cache - In Photos dot org
Donncha,
Any reason why the number of cached pages keeps showing up as 0?? Everything seems to have installed correctly, but the number of cached pages in the Options panel is always 0! Any ideas?
Thanks
Aseem – have you checked your cache directory? Also, the cache is disabled by default, it has to be enabled.
You should also click the “Regenerate stats” button to force the stats to update. I don’t do it on every page load because it has to iterate over sub-directories and could be too heavy.
Donncha,
I checked the Cache directory in wp-content/cache and it has only cache files from yesterday (before I turned on wp-supercache. It doesn’t have anything after that in the cache. I also went to the Options and I do have it set to Enabled. I do not have Super Cache Compression enabled though. Still everything is 0 for both WP-Cache and WP-SuperCache!!! I might have to switch back! I would really like to use this though, please help! Thanks!
Should I delete the cache folder and see if that might be causing the problem since it was already there???
so as long as i have mod-rewrite (which i do) it will work just fine? i would love to test it, but the site i would like to use this on is very busy and i can’t test on it. :/
also, i notice your script says to remove the cache define in the config … isn’t this required in order for the cache to work?
Okay…. Where’s PHP.INI?
I use cPanel here for my hosting and I was using the file manager and I cannot find PHP.INI
Before anyone laughing, I’m freakin’ new to this stuff… so, go easy on whitey…
-Chuck
donnie – it’s recreated and added back in when you install the new plugin.
Chuck – you probably don’t have access to it as it’s generally “root” who edits that. You can still use the plugin however, just disable compression. If PHP is already compressing things then that’s good too.
I’ll need to add another radio box and separate out super cache and wp-cache compression.
Donncha,
I still can’t seem to get any pages cached! Everything was done correctly…enabled…etc, but nothing is being cached by either cache method. Something is definitely wrong! Any ideas? I explained more in the comment I left a few mins ago.
Thanks
Aseem – have you updated your plugin since yesterday? Download the zip file from the page above and install that. Never mind that the version number on the WordPress.org page says 0.1, I messed up the readme file when I was making the release!
So, basically, you’re turning it into Movable Type?
Well done; I’m a little sick of waiting 20 seconds for any vaguely popular WordPress blog to load…
It was, the graphics on my template were not loading… I couldn’t figure out why… anyhow, I’ll just stick to Wp-Cache.
(RE: Windows linking stuff, it is apparently possible to produce a good approximation to symlinks on modern Windows. You do need a special tool from MS to do so, though, so it may not be too practical…)
I just installed the new version. It works fine. for one, I didn’t have my gzip compression turned on, on wordpress, because the old plug in said I had to disable it. So, I turned that on. and installed the new one, and it’s working great, compresson and all.. I also added said stuff to the .htaccess file as well. everything seems to be humming along now.
-CHuck
Chuck – that’s great, glad it works now!
Donncha,
Thanks for taking the time to create this plug-in. I tried installing it an hour ago and it asks me to set WP_CACHE to true, which I do. When I do that, my entire site disappears and loads (and reloads) blank. Any thoughts on that?
thanks!
Pingback: ZieDesign | Blog of a Freelance Designer » Blog Archive » WP Super Cache - The Ultimate WordPress Caching Plugin
Oh go on Robert, get the kick in
You’re definitely being disingenuous to WordPress.
Not at all, not at all. I have found, however, that very popular WordPress blogs where the owner is using wp-cache but not some memcached magic are intolerably slow, in general…
I got news for you man, WordPress smokes Moveabletype’s Butt any day of the week. MoveableTypes doesn’t even acknowledge WordPress’s trackbacks for Christ’s sake!
Moveabletype is for idiots who have more money than common sense, give me wordpress any day of the week. Even if Matt is a butthead.
:-O
*shrug*
My MovableType blog must be special; it’s fine with WordPress trackbacks.
Seriously, though, Donncha, well done on this. It seems to remove the single biggest issue I had with WordPress, and what drove me away from it in the first place. Any chance of getting it in the distribution?
Ya know, I might be thinking of typepad or something, I’ve sent trackbacks to moveabletype blogs before, and they never showed up. I believe that with typepad, you have to send them too the proper place or something odd like that. With WordPress, you just have to reference the link in question and bam, it shows up. Or could have been the guy wasn’t accepting them. So, I could be wrong.
Think I like about WordPress is, IT’S FREE! AND FREE IS VERY GOOD!
Especially for us poor white folk!
Robert – thank you. No chance of it going into WordPress. As you can see from comments above, it doesn’t work on all servers. Cent OS servers in particular don’t like the compression code but I’ll fix that one way or another.
WordPress is getting much better caching now. The xcache plugin I linked to above is superb and comes very close in performance terms to the static file being served to anonymous users here. Ryan Boren is working on a caching module too, so WordPress 2.4 could be pretty sweet from that perspective.
Having a problem (I think). When I hit the Delete button on an expired cache page it deletes all of the cached pages.
I would not think this was expected behavior as each page has its own delete button.
Any info/suggestions?
Thanks.
Donncha,
Suggestion for next release.
the ability to list cache pages and Super cache pages. each have it’s own seperate button.
-Chuck
Awesome, I’ll run some tests on my dev. server to try it out.
WindowsObserver – you mean on the “List Files” part of the admin page? That’s something I haven’t looked at yet tbh. Thanks for reporting that.
Pingback: Chat Marchet News Digest » WP Super Cache - The Ultimate WordPress Caching Plugin
Pingback: ATOMICSHED » WP Super Cache - The Ultimate WordPress Caching Plugin
Dreamhost didn’t like the Super Cache compression. It gives you weird characters when you have “super cache compression” enabled.
I’ve been using WP-CACHE for a while and have fund it to be a lifesaver when my site has a post go Digg popular. But even then, there are limits — if the traffic from Digg is too much the site still hangs…
The other issues fixed (gzip, etc) aren’t really of interest to me since really. The only thing of value is if the caching is actually faster.
Should I make the switch? Is it really a significant caching improvement? I’d hate to make the switch just to find that the caching itself is basically the same…
Deaf Musician – that would be PHP’s compression kicking in. Disable compression in the backend and it should work. Thanks for that!
Darn!!! Thank you for this… just one question: How can some portions of the static page still be kept dynamic using your plugin? I’ve been dying to get something where certain plugins I use can still be kept dynamic and not cached like: the Recent Comments Plugin, the wp-views plugin – the views plugin in particular, cache plugins are great but features like number of views of a post get massacred… is there a way to include some generic features where WP users can include such plugins not to be cached or cached until any change occurs (like views get changed etc.)
Oh yes, this post is on the front page of Digg.com and the server is barely ticking over. That said, it’s been a *very light* digg with only 2000 hits in the last hour and a bit.
Oz – you could now write plugins that clear the cache when your various dynamic plugins should be updated, or use Javascript to fill in the space on your page.
21st C – why not give it a go? It’s not as if you have to pay for it!
21st Century Citizen,
Yes, Yes and Yes.
Switch now, you’re Blog will love you for it. Just be SURE and follow the instructions!
I didn’t the first time and I had a problem.
But it works fine now!
-Chuck
Pingback: Chuck Adkins » New Awesome Wordpress Plugin!
Donncha, thanks. Unfortunately I’m not a programmer to understand what you just mentioned
Is anyone working on integrating wp-views and recent comments plugin with Super Cache? It would be nice to see a step by step process for non-techie bloggers like me
Pingback: Noscope | Journal | WP Super Cache Plugin
I’m getting a nice little error…
Fatal error: Call to undefined function do_cacheaction() in /home/user/public_html/wp-content/plugins/wp-super-cache/wp-cache.php on line 172
any ideas?
Jonathan – symlink wp-content/advanced-cache.php to wp-cache-phase1.php if it’s not there. That error will hopefully only show once right?
I’ll wrap that in a function_exists() call for the next release. Thanks!
Can you give some hints as to exactly what “expire time” does and how we should determine what to set it to?
Donncha,
Seems like it already is..
user@domain.com [~/www/wp-content]# ls -la
lrwxrwxrwx 1 user user 72 Sep 24 17:17 advanced-cache.php -> /home/user/public_html/wp-content/plugins/wp-cache/wp-cache-phase1.php
Ah, I figured it out.
I removed the old file, refreshed a couple times, disabled, re-enabled, and now the error is gone.
Thanks!
Rob – expire time can be any time you want. Super Cache is set to 6 hours by default, but it all depends on how often you want dynamic elements of your site to update.
When you make a post or a comment is left the cache updates, but things like “latest comments” widgets won’t on every page.
I am a little confused about compression. In Options, should I be enabling compression? If so, do I need to comment out zlib in php.ini as indicated by this page (but NOT talked about at all in the README)? What’s the story?
sygyzy – Yes you should enable compression in the admin page, and yes you should remove it from php.ini
It’s not in the readme because that feature was updated this morning and I didn’t see that my photoblog, http://inphotos.org/ was displaying actual gzip content, and then it took me about 10 minutes to figure out it was PHP’s internal zlib compression. This site wasn’t affected because that wasn’t enabled. Unfortunately that was after I made the 0.2 release. I hope I can follow in a few days time with a minor 0.3 update with a corrected readme file.
Pingback: blognation Ireland » Blog Archive » Super Cache Makes Your Wordpress Blog Super Fly
Donncha,
I downloaded the latest version and uploaded it and STILL HAVE 0 CACHED PAGES!!! There is something really weird going on here. Any ideas on what this could be???
Thanks
Pingback: Wordpress Super Cache | Bitperbit
Donncha,
I have not touched my php.ini and I have compression enabled and I don’t see anything broken. Is there any sort of debugging feature to see what’s going on behind the scenes? I will make the php.ini change like you said but I don’t see any ramifications without it. It certainly does not seem to be breaking the caching.
Thanks.
I’m not sure what I’m missing. I am using wordpressMU 1.3. I decided to install the plugin to the plugins folder to test, but when I go to the options page I can only see:
WP Super Cache Manager
Main options
and nothing else. No check boxes or error messages either on the screen or in the php error log. Also, none of the cache folders are created. Any ideas?
Thanks
Could I suggest something allong the lines of the following since very few people have their own box for wp or access therefore to php.ini.
http://blog.iloaf.com/2007/03/15/make-wordpress-quicker/
You’d need to add only 1 line to get the html parsed as php and tf compressed.
I installed the new version, but I still get ‘text/html’ on feeds, even with the flush() call added when trying to get the headers.
I really think the only sure way to fix it is going to be to check is_feed() in wp_cache_shutdown_callback(), like in my old patch:
http://dougal.gunters.org/blog/2007/06/19/wp-cache-fix-for-content-type-in-feeds
However, don’t use that patch as-is, because yesterday I applied that to your code, and my testing turned up that the ‘feed’ query variable isn’t set in the default case (when a specific feed type of ‘rss’, ‘rss2′, or ‘atom’ isn’t requested). How about I just go ahead and submit a revised patch in the plugins trac?
Dougal – please do submit a patch!
I’ve tried the WP Super Cache, and all appeared to work smoothly until I viewed the site in IE 7 where I saw all sorts of “MySQL server has gone away” errors. I’m using WP 2.3.1. Any thoughts? Anyone else experience this issue?
you need to install a paged comments plug in around here…
I have it, and can zip it up and send it, if you like.
Hrm. For some reason, wp-super-cache isn’t listed yet when I try to file a bug on dev.wp-plugins.org. Here’s a link to my patch:
http://dougal.gunters.org/projects/wp-cache-phase2.php.diff
How do you exactly go about using the do_cacheaction().
I’m hoping 0.3 will have a readme that’ll be kind to php newbies like me
Oh yeah, another buglet I noticed: When I go to delete a single cached file, it deletes the whole cache, instead.
Sorry about spamming with so many comments
Love it already! Options are just right as well. Thanks for the hard work, I dugg it.
Pingback: Wordpress Super Cache « Hone Watson Bookmarks
Just tagged 0.3, phew.
Changes:
1. Fix feed content-type, props Dougal
2. Check the do_cacheaction() exists in wp-cache.php
3. Copy file if symlink is not found
4. Move WP Super Cache to “Site Admin” menu on WordPress MU
5. Don’t compress WP-Cache data files is PHP is already doing it
Hopefully fixed the version number on the WordPress.org page!
Has anyone else been able to successfully do a copying of wp-cache-phase1.php -> advanced-cache.php instead of symlinking? I’ve tried but it still says it’s not there (even though it is, http://catchwa.org/wp-content/advanced-cache.php exits)
Donncha, you might want to change the version number in the plug-in so people don’t get confused.
Pingback: robinadr § WP Super Cache
Pingback: Daily Links | Akkam's Razor
i installed wp super cache and it shows 0.1 as the version on the plugins page.
how can i be sure this is working properly? i’ve followed the directions step by step. i can see cache pages increasing, but not super cache pages.
Very nice. Will try it out soon.
I’m getting the following message on the options page:
“Install is not complete. Please delete wp-content/advanced-cache.php”
But when I delete the file, my site blows up until I restore it.
What am I doing wrong?
The super cache plugin managed to increase my load.
You should read the how it works section… Super Caches are only created when people who aren’t logged in view a page from what I can understand.
By the way I was wondering, a caveat is that someone who is if you’re logged in or write a comment, but what do you mean by this? Do you mean that you won’t use the benefits of Super Cache? Or does it mean that if you post a comment it won’t update and will appear as if it wasn’t posted until the cache expires?
sorry for the constant posting. i view the site not logged in and view the source and i see this.
in the wp-super-cache admin screen i see this.
WP-Cache
* 497 cached pages
* 44 expired pages
WP-Super-Cache
* 1219 cached pages
* 0 expired pages. (Generated 22 minutes ago. Refresh in 38 minutes.)
so obviously super cache pages are being created, but i am not seeing any of them served.
http://www.everydayshouldbesaturday.com
can someone verify if they see the super cache pages being served?
@donnie
I was under the impression that you weren’t supposed to have WP-Super-Cache and Super-Cache active at the same time? (Step 2 of the installation instructions in the readme.txt file)
sorry, I meant WP-Super-Cache and WP-Cache active at the same time
@donnie
ugh, apologies – I’m totally off-track
as for my own problem, it seems to be fixed. Fiddling with the permissions on advanced-cache.php seems to have fixed it
Donncha, this is a fantastic plugin! I just implemented it on the WebGeek Blog and it rocks…blazing fast. Excellent work!!
Thanks, Donncha
Symlinks shouldn’t be a problem, w/ WP-Cache I took care of them by either copying the file directly or by creating a hard link to the target.
WP-Cache had some weird problem (that shouldn’t have occured) that I wasn’t able to pin down when creating the .meta files for posts so that it ended up “caching” the page each time it was viewed. It worked just fine for index pages and feeds though.
I’ll give this a shot and let you know how it goes
Looks great and I’m considering replacing WP-Cache with this on my site — http://www.finalgear.com/
We don’t have load issues or anything due to an uber box, but it’d still be nice to optimize further to keep more CPU available.
However, I have a question: The point of this plugin is to go completely static, right? I ask as I have a part of the site that’s currently dynamic and generated via a little databaseless PHP.
One more comment. Just got everything running. For the most part, it’s awesome. The only thing causing a bit of trouble is the Rejected URIs part of the config page. No matter what I enter, it still caches every page, even if they contain one of the listed strings. (I did save them so I know it’s not that.) IT creates a problem only because I have several tools pages that need to update via PHP each time it loads. Any thoughts on why that might not be working and how to fix?
Will this work on older versions of WP? I’m still using the 2.0.X flavor.
I’m having the same problem with Rejected URIs as WebGeek. It looks like everything is getting cached and super-cached whether they are in the exclusion list or not.
maybe its not updated because the version tag in wp-cache.php is not changed?
thanks for the update (0.3)
Sara – that occurred to me this morning. I’ll have it fixed shortly
Fantastic plugin Donncha. Page load time here is amazing considering front page digg. Installing on a few blogs already and is working a charm. A shiny penny for you.
good
mh.. maybe it should check if apc cache or eaccelerator is installed and use it for caching? and if both are not installed on the sys, just go ahead like usuall wp-cache/super-cache?
just a stupid idea..sorry.. and i dont know if it would improve caching using apc or eaccelerator functions..
have a nice day
Pingback: Donncha’s Wednesday Links at Holy Shmoly!
Pingback: How well did Super Cache handle the digg? at Holy Shmoly!
Pingback: The Ultimate WordPress Caching Plugin | Tech Tips
Pingback: eric.polerecky.com » Blog Archive » links for 2007-11-07
nice work Donncha! how does the plugin cope with WP’s integrated object caching?
Thanks so much ! It is a truly Super plugin and has sped up Storynory no end.
how does this determine whether or not you have made a comment? is it only per post or if you make 1 comment then you get regular cache the rest of the time? i understand if you are logged in … so i used a different browser and made sure i wasn’t logged in but still get the regular cache, nothing from super cache. maybe it’s something with the .htaccess since i am not using the fancy permalinks.
http://www.everydayshouldbesaturday.com
can anyone see the super cache pages?
RE my earlier question:
I went ahead and moved a dynamic PHP header to a JS image picker and switched the leftover PHP dynamic stuff being called via AJAX. So the page won’t be completely PHP free, but I think WP Super Cache + a little AJAX is better than WP-Cache’s silly includes.
That wouldn’t work as you’d have to load up PHP to fetch the files from the cache engine, at least from my understanding. Defeats the purpose of this plugin.
However, you can tell your cache engine to cache the “cache” folder to RAM and serve it up from there rather than your hard drive. I’ve done that on my site with WP-Cache for quite a while.
Viper: Your operating system should, in any case, cache frequently-used files itself.
Viper – I wonder if we’ll see the rise of Javascript widgets again if this plugin becomes more popular?
donnie – WordPress has a “hook” that is executed each time a comment is left. That hook clears the cached file for the post the comment was left on, and also clears the main page’s cached file too, just so widgets get a chance to refresh and fix comment counts.
I only see WP-Cached pages, no the “super cache” string in your footer. Check your wp-cache-config.php, your .htaccess and finally your cache directory!
tomás – WP’s internal caching is a whole different beast. It’s completely separate. They don’t interfere with each other at all.
Sara – using memcached to store the cache isn’t such a bad idea. I know a certain *large* WordPress site that does that, but they have dedicated 4GB memory servers for that task!
Lincoln – it should work, I hope. Give it a go!
Michael Feldstein – make sure the advanced-cache.php link points at the wp-cache-phase1.php in the wp-super-cache folder, not the wp-cache folder!
Jorge Peña – if you’re logged in or leave a comment, you’ll always see WP-Cache generated content. If you delete the WP cookies you’ll see the static content again!
Dougal – yes, must fix that. Also the list doesn’t reflect what’s stored in the super cache.
sylv3rblade – look at plugins/searchengine.php for an example plugin that uses those actions.
I installed a “paged comments” plugin but it’s annoying. I like that the newest comments are on the front page, but I’d prefer if they were in descending order. Hopefully that can be done. I need to look at the config file again.
i didn’t think i needed to edit/rename the wp-cache-config-sample.php file … i just made the settings in the admin area.
Donncha: yeah, i know they’re a whole different story. but I remember there used to be problems between WP-Cache and WP’s object cache. just as there was a bug using WP-Cache together with APC… or even with some plugins, such as Democracy.
k, the config file was completely different, so i replaced it with the new one, made the changes. still no super cache pages. i did notice one thing i think should be changed if you are not using fancy permalinks … every where it says %{HTTP_HOST}/$1index i changed to %{HTTP_HOST}/$1/index because fancy permalinks contain a trailing slash where the default doesn’t.
Donncha, any word/thoughts on the Rejected URI’s not working? Thanks!
Not knowing how to do a symlink, I copied wp-cache-phase1.php to the appropriate folder and renamed it “advanced-cache.php”. However, when I open that file, I find that it’s empty. Sorry for the dumb question, but how do I get the file to “point” to wp-cache-phase1.php?
hi Donncha,
hm.. i know.. but using a little bit eac or xcache or apc cache together in one module / plugin would be really a big deal, or not?
try this paged comment plugin, its better in my opinion..
http://wp.uberdose.com/2007/08/19/ajah-comments/
please, let us know when the new version is out.;)
Alright, just released 0.3.1 and added a changelog: http://svn.wp-plugins.org/wp-super-cache/trunk/Changelog.txt
The main change in this release is using preg_match() to match rejected uris. You must change “wp-” to “wp-.*.php” or else it’ll start matching posts and pages with “wp-” in the URL again.
http://wordpress.org/extend/plugins/wp-super-cache/
Pingback: Me Blog! » Blog Archive » Supercache, eAccelerator and Wordpress - Benchmarks
Hey, great plugin, I tried running it on my site for a while and it really sped things up. Unfortunately I had to disable it because when I was working on the site I started to notice that whenever I would reload a page something would go wrong and i’d be served a blank page, upon refreshing that page I’d then get the correct page. Reload that -> blank page… so on and so forth. I tried disabling compression and it just turned that blank page into a 500, but still the 50/50 proper page / blank(500) page.
What’s weirder is that this only happened in Firefox and stopped happening once I disabled the plugin and uncommented the .htaccess mods.
Oh, this was in 0.3 and 0.3.1.
shoot me an e-mail if you need any more info.
Pingback: Tech Tips Online | Ultimate WordPress Caching Plugin
Pingback: » Wordpress Super Cache, plugin para Wordpress | Informática Práctica |
Pingback: Keep Running Wordpress | Simon Emery
Also, if you are server super cached pages, searching seems to be broken.
I am running Windows with IIS 6 and it seems that the caching is working, but the admin options page for wp-supercache is just a blank white page… no options at all. I have followed everything in the readme.txt file – anyone else have this?
Pingback: Devlounge | WordPress Caching Overview
Hi Donncha,
… when I saw that you mentioned everyone else in your post except , myself, in the people who have worked on WP-Cache .
I have to say that you … broke my heart
Just joking of course – that’s the beauty of open source , a lot of people make most of the hard (and exciting ) work first and all the credits go to those who ” pretty package” do the (boring) job of polishing things up to share them with the rest of the community…(I DO NOT mean you of course) Thanks for doing this service to the WP community!
You seem to have done a very interesting job (It’s a pitty I am currently involved in Semester exams and can’t take a more detailed look in it) so I will have to delay further / more technical comments
I am mostly interested to see how you have managed to implement gzipping of pages including parts that need to dynamically update each time the page is loaded , cant get it right now how the hooks are called from the gzipped file!
The dynamic content problem has been puzzling me for long and kept me from releasing a “Shrink wrapped / ready to install plugin” gzip enabled version .
I am very happy seeing that someone better than me has managed to tackle it!!
Best Regards,
Nick
It seems that there is a vulnerability in the plugin. Several people on twitter mentioned it (factoryjoe as the first) and I just deactivated and copied my cache over just to see that half my server was mirrored in the supercache folder. The vulnerability seems to be injection of .txt files as parameters which don’t get filtered out before the cached files get written!
Another issue that’s come up…some pages are being cached and so are the credentials for comments. Actually, the comment form says logged in as Administrator even if you open it from a different computer that has never loaded that page before. Looks like when it cached the page, I must have been the first one to view it while I was logged in and therefore it cached that.
Any way to fix it so that it does not cache the logged in version of a page?
Thanks
Darn, I was hoping this would fix my problem with WP-Cahce, but it doesn’t. I used Goddady shared hosting, and when I use this plugin (or WP-Cache) I get a 500 internal server error.
Pingback: Getting WordPress Super Cache to Run on a Windows (IIS or Apache) Server at The NeoSmart Files
Donncha, I’ve sent you an email about making the code Windows-compatible, just a few minor changes; with a couple of non-Windows-related bug reports as well.
For people looking to run WordPress Super Cache on Windows in the here and now, here are the steps: http://neosmart.net/blog/2007/getting-wordpress-super-cache-to-run-on-a-windows-iis-or-apache-server/
Runs on both IIS and Apache on Windows.
I’ll be benchmarking it soon!!!
Pingback: ...time is what you make of it...
Pingback: Wait till I come! » Blog Archive » wp-super-cache cached too far for me (and others)
Pingback: Random Linkage » Random Linkage 2007-Nov-07 PM
Pingback: Super Cache, XCache, and more! — Brad’s Ramblings
Pingback: EricByers.com » Wordpress APC Object Cache Issues
Great plugin! I have tried it and it looks like something I would definitely use. However, one thing I’ve noticed is that my ajax rating images will never be updated while the cache is generated. Is there a workaround for this? The rating plugin is called Wp-PostRatings
Thanks!
Chris and I are exchanging emails and trying to figure out where his server was exploited. The Super Cache plugin will cache the path of the exploit filename, but it stores the 404 message or whatever WordPress displays.
If anyone finds files from outside their webserver path or blog stored in the wp-content/cache/supercache/ folder then please contact me immediately at donncha at ocaoimh.ie
I don’t know how to create a symlink, is there any other way I can fix the error that says “advanced-cache.php link does not exist”?
The FAQ in the Readme says “copy the file”
What file should I copy to where?
John – copy plugins/wp-super-cache/wp-cache-phase1.php to wp-content/advanced-cache.php
I thought that was pretty clear from the rest of the sentence. I’ll try to make it clearer.
Great plugin!
I’d just like to reiterate what Deaf Musician said. DreamHost with compression = funny characters.
I copied ‘wp-cache-phase1.php’ to the ‘wp-content’ folder and renamed it advanced-cache.php, but I still get the error saying “advanced-cache.php link does not exist”
When one switches themes the cache is cleared using the ‘switch_theme’ action but when the widgets on the sidebar are changed the cache isn’t being cleared. I could not find an action for that.
Elad – that’s bad! There must be an action we can hook into to clear that cache. I’ll take a look too.
John – That’s strange. Did you have WP-Cache installed before? The error shows up because the do_cacheaction() command wasn’t found in the advanced-cache.php file, which means the wp-cache-phase1.php was copied from the original WP-Cache.
Nick Georgakis – please accept my apologies for the oversight. I saw your name in a patch but because I was under a lot of pressure I didn’t look for your blog and then forgot to include your name in the Changelog. And no, when a file is cached as a static html file then there are no dynamic parts. The best thing to do for dynamic content is use Javascript like in the good ol’ days of sitemeter
I’ve never used WP-Cache. This is my first time installing any caching.
By the way, I’m using WordPress 2.3.1 on Linux/Apache
The files I’m using are only from the Super Cache plugin download version 0.3.1
Pingback: Vulnerability in WP Super Cache v0.1 | FactoryCity
Pingback: Webgrrls Wisdom » Improve wordpress blog performance with Super Cache
So have the possible php injection vulnerabilities been confirmed/fixed?
I was just getting ready to install this when I heard about the possible problems.
Any news?
JimmyJoe – I’m fairly confident it’s not a vulnerability, just a small bug that created the supercache directories in the wrong place.
I have a few questions about the WP Super Cache options page.
I see that there are separate options for WP-Cache and WP-Super-Cache, which pages get cached by WP-Cache and which pages get cached by WP-Super-Cache?
Good work on your plugin, thanks. I am also getting a problem where a previous commenter’s name is cached on a single post page. The preg-match doesn’t like forward slashes in the excluded strings box… i.e. when you use /2007/ as in the example above the box. Thanks!
RobotDan – are you using my friends adverts plugin? Or have you enabled that plugin the super cache admin page? The next release will have a fix for a minor bug that might cause what you’re seeing.
Donncha
No, the options page confirms that the adverts plugin is disabled.
Hey this is one of the most useful plugins I’ve come across! I just built a website for a large company that gets TONS of traffic and this saved the site from time outs and blank pages… just one question – will this effect pageviews from a statistics point of view? Someone I work with had told me he installed a cacheing plugin on his WP blog (not this one) and he said that the cached pages were not counted in his pageviews from his stats program? I just want to make sure that this isn’t the case for this plugin.
Lindsey – if you use a stats program that uses Javascript to count visits then you’ll be fine.
RobotDan – can you try and debug it and figure out a pattern? Leaving a comment should remove the previously cached page.
Hi there Donncha,
This is an exciting project for me! I really look forward to trying it out and hopefully getting more from my server.
Do cached pages require any database queries? I ask this because my hosting has a SQL server on a different machine, so database queries can be slow due to network congestion – even on simple selects. At the moment my page render times are about half a second on average – will your plugin cut this down?
Also, can you specify cache life? I’d set mine to about 6 hours or so maybe to reduce database activity to a bare minimum!
Thanks for all your hard work on the WordPress platform!
CalonDdraig – sounds like the perfect fit for you. Static cached pages don’t make any db queries but when someone is logged in or left a comment then caching is handled by WP-Cache which means PHP is loaded. If a cached file is found then no, generally there are no db queries.
Thanks for that – it’s an absolute dream!
My page render time has gone from 0.7 seconds to
Pingback: » Speed up your blog! - Calon Ddraig’s Herbarium
Donncha,
Is it possible to use the wordpress search using Super Cache? When I try to search on a Super Cached page I’m taken back to the index. When I’m logged in and search and the page is served with WP-Cache, it works.
Vic – if you try the development version of the plugin you should hopefully find that searches work again. They won’t be “super cached” but they will be cached by WP-Cache.
Pingback: Wordpress Super Cache | BlogPuff // Noticias - Internet - Styles, Vista Themes, Wallpaper, Iconos, Css, Design, Recursos Web, Photoshop
Pingback: Wordpress Super Cache | Blog GeekDiario.com // Ultimas Noticias - Internet - Blogs
Pingback: WordPress 2.3.1
For wpmu I would also clear the cache when blog is marked as spam, archived or deleted.
for some reason, all of the pages stored in the super cache are now the index page. :/
i have noticed one thing. some characters are being altered in the super cache pages.
orig : altered
“ : “
†: â€Â
’ : ’
‘ : ‘
you can see it on this page: http://www.everydayshouldbesaturday.com/2007/11/09/degenerates-unite/
I did a new combo of plugins and the Result, the fastest possible performacne on wordpress – with Hyper Cache and DB cache Reloaded
http://www.taranfx.com/blog/best-fastest-alternative-to-wp-supercache-hypercache-db-cache-reloaded
Thanks for the good work. I was running WP-Cache fine with GZIP mod, but with Super Cache I get the “save the page” prompt in Firefox. How come GZIP works for me flawlessly with the mod WP-Cache but Super Cache makes Firefox prompt to save the page?
This shows the compression issue it’s not with the server configuration (again WP-Cache modded to serve GZIPed pages was working flawlessly), but with Super Cache.
Any ideas are very welcome, I really want to use Super Cache but need compression.
yeah, what he said… I had to disable the compression myself.
Finally got the thing up and working on my site and seems to be doing great. Thanks!
Hi!
Great plugin. I have a question. My web page is hosted by godaddy and there is a known problem with cache plugins and this host with the header “Last-Modified”
http://www.littleredrails.com/blog/2007/09/08/using-wp-cache-on-godaddy-500-error/
is there any solution to this?
Thanks!!
Really great Plugin! Are you still maintaining it? Does the 0.2 version work with the newest WP version?
Awesome plug in here thanks “”
Very useful plugin. Thank you.
Very useful plugin. Thank you very much
Hi Doncha,
Thanks for the great plugin.
I have a slightly off-topic question, but I saw your post about memcached on wordpress.org.
I using the object cache -> memcached replacement files from http://dev.wp-plugins.org/browser/memcached/trunk and I’m not sure how to set the memcached cache to expire. I’ve tried adding an expiry in wp-config but that isn’t working.
Do you know how to reset the expiry time of the cache? I’ve got memcached working via a slave server but nothing I try works to expire the cache.
Thanks again!
elio – you set the cache time when you call wp_cache_set/add/update, otherwise the default is used. Can’t remember where that default is, but it’s an hour AFAIR.
Pingback: Lessons from LTPact 2008: Cloud Servers and Gambling « Lorelle on WordPress
Pingback: blah, blah : WellnessBooth.com
Pingback: Lessons from LTPact 2008: Cloud Servers and Gambling
Hi Donncha,
WP Super Cache is a great plugin, I use it since I set up my blog.
But I found cache the whole pages is not aways that necessary, so I write a new cache plugin WP Widget Cache, which can cache the output of blog widgets. I think it’s a plus for WP Super Cache, and will significantly reduce the cost for WP Super Cache to cache new pages, especially when Google is crawling the site.
Here’s the plugin url:
http://wordpress.org/extend/plugins/wp-widget-cache/
Looking forward to hear you thoughts.
Pingback: Digg.. Reddit.. Stumbleupon | Hawk Host Blog
Pingback: 5 Tips For Digg Proofing on Sam Parkinson
Pingback: Súper cache para Wordpress
Pingback: Internet Marketing ABC » Blog Archive » How To Handle Huge Amounts Of Traffic (With Wordpress)
Pingback: 2010å¹´ã‹ã‚‰ã¯Webページã®è¡¨ç¤ºé€Ÿåº¦ã‚‚PageRankã«å½±éŸ¿ã™ã‚‹ã‹ã‚‚ã—れãªã„ – ヒãƒã‚«ãƒ¯ã‚ºã‚¿ã‚¤ãƒ—。
Hi,
I have been kindly left (had dumped on me) a website which has started displaying an error “Parse error: parse error in /html/news/wp-content/plugins/akismet/.wp-cache.cache.php on line 1″. I am a software developer but I have no experience in PHP and I am unsure of where to start.
If you could provide any pointers as to what the problem might be that would be greatly appreciated.
Thanks in advance.
Declan – delete the file or move it out of the way, that shouldn’t be in the akismet directory. Your site may have been hacked. Look for the WordPress Exploit Scanner to do a scan.
Hi,
As a temporary measure I rename the akismet directory and the problem has gone away. I will investigate further as to security of site.
Thanks for your help.
I recently install Word press I really want to use Super Cache but need compression.