WP Super Cache 0.8

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

If you’re not interested in the changes, simply grab the latest version of the plugin and copy the files into your plugin folder. It’ll work, but if you’re upgrading, you should read on.

Major changes in this release:

Generate a semaphore id based on hostname and cache path to avoid problems on shared hosts, props Tigertech.

If you run WordPress from a different directory to where it’s installed, supercached files weren’t deleted when a post was made or updated. That is now fixed. Thanks Viper007Bond for all your help on that.

Paged archives, category pages, and tag pages are now cleared when a post is edited or comment approved. This replicates what WP Cache did all along so you should hopefully see supercached static files updating more often.

If your .htaccess is read-only, the mod_rewrite rules are displayed on the admin page. Thanks Matt for the patch.

Updated mod_rewrite rules won’t serve static html files if there’s a “=” in the url. Should catch all sorts of problems with plugins and attachments. You’ll have to manually edit your root .htaccess to match the new rules.

Set cache control and expiry headers of supercached files. They are cached for 5 minutes, but with a “must-revalidate” header. Delete wp-content/cache/.htaccess for the new rules to be updated.

Check for WordPress MU because it can’t update the .htaccess file.

Write supercache html to temporary files and rename. The old way opened the correct file for writing, did some work and wrote the file. In the fraction of a second it took to write the file, someone might request it and get an incomplete page.

just upgraded the plugin to version 0.8….now big problem, when i go to a cached page i have the message for example (it is the same with all the supercached page) :
Forbidden
You don’t have permission to access /wp-content/cache/supercache/www.neomansland.info/2008/09/le-fauteuil-poubelle//index.html on this server.

I’ve been to see the permission of the file index.html for these pages and it is at 600 instead of at least 644 for people to have the ability to read the file.
I’m using WP-super cache since a long time and always update it with the process indicated in the wordpress plugin page. IT was working nice with previous version 0.7.1.
IS that a bug of this new version ? or is there something i missed during the upgrade process ?
thanks a lot.

Computer Aid – there was no need for it, and now that the plugin is more aggressive about clearing out of date cache files it doesn’t make sense any more. It also confused people why it was there in the first place!

ok i’ve try what you tell me, i clear the cache. it seems to work now but there is a strange thing that happen.
I use http://tools.pingdom.com/ in order to check the loading speed of my blog. Before version 0.8 of wp super cache, everything was fine, it told me the speed to oad my blog. Now when i enter my address it told me :
URL doesn’t exist: http://www.neomansland.info

For the permissions, user get the permission to read and write, then groups have no permissions and other none too.

My webhost don’t change nothing today has it was working before upgrade of wp super cache, the problem appears when installing 0.8 … or maybe my webhost has changed something just at this moment but i don’t think so.

i forgot to told that for the autorizations it is only for the files inside the folder supercache.
For the others wp-cache-xxxxxxxx.html the permissions are :
user : read – write
groups : read
others : read

I’ve came back to version 0.7.1, now files that are in the folder supercache have these permissions :
user : read-write
groups : read
others : read

there is something with version 0.8 that remove the permissions of reading of groups and others…resulting in the forbidden message.
Also i redo the test with pingdom tools and now my url is accessible….

Okay, I don’t know what went wrong where, bu 0.8 completely killed my site. Pages would no longer load unless I was logged in (some kind of weird extreme delay issue that I can’t work out.. pages simply never finished building and never returned anything), the new rewrite rules don’t work at all (resulting in page not found errors), etc.

Reverting to 0.7.1 and clearing the cache fixed it more or less instantly.

@Donncha: I experienced the exact same issues as Neokentin. At the moment I have switched to Half On but it looks like 0.8 is mucking up the group and world read permissions. I had to clear my cache and drop back to half on to avoid forbidden page errors.

Mellow, Otto – I think I know what’s happening. I’m guessing that Apache is running as a different user to php on your hosts. Somehow the “write to temporary file and rename it” process changes the username in a way that writing to the original file did not do. I’ll add a chmod to make the files world readable.

hi, i tried this great plugin lots of time, but never used! it always cached 0 pages. Could you explain “You should have mod mime, mod rewrite and fancy permalinks enabled”? I use permalink structure. PHP Safe mod disabled.

Binh – the best thing you could do (and I think I said this on the forum too) is to hack wp-cache-config.php and exclude the or include the blogs you want cached or not.
There’s already code in there for identifying individual blogs so it should be easy to hardcode an array of blogs you don’t want cached and then set $cache_enabled to false.

Hi Donncha!
Thanks for great plugin, it`s very helpful for me. But I slightly hack it.
I use Super Cache to PRE-fitch pages with cron to human. My cheap VDS is very, very slow – 300 Mhz, 128 Mb.
When I wont to collect RSS-feed (./news/) with SimplePie from 20-30 feed and re-arrange field at date it took about 30-40-60 second. Terrible lag!
I dont understood php for make something new, but I can to break something existing.
So, I change part of code on file advanced-cache, where
“$key = $blogcacheid . md5($_SERVER[‘HTTP_HOST’].preg_replace(‘/#.*$/’, ”, str_replace( ‘/index.php’, ‘/’, $_SERVER[‘REQUEST_URI’] ) ).$wp_cache_gzip_encoding.wp_cache_get_cookies_values());
”
to
“function key_managment(){
if(preg_match(“/\/news\//”,$_SERVER[‘REQUEST_URI’]))
{
$key = $blogcacheid .md5($_SERVER[‘HTTP_HOST’].preg_replace(‘/#.*$/’, ”, str_replace( ‘/index.php’, ‘/’, $_SERVER[‘REQUEST_URI’])));

Then I set cache time to 19 minute and cron time to 20 minute, and it work`s well!

So, is it possible to include something liking that to original plugin? I mean include option to cache some pages with time to live at one side and single named this pages for everyone, avoid mix name with cookies or something else, at another side.
I understand very well – its hole at security, but think sometime its useful.

PS. Sorry for my English – I`am from Russia and learning in school hmm…. so-so 🙂

I just checked in some experimental code that keeps copies of supercached files around after a comment is made so that anonymous users will see a slightly out of date cached file for a few seconds, but it should help a LOT on sites that receive lots of comments.

‘Course, I’m not sure if it’s worth it because the extra code does a lot of file checking and smaller sites won’t see any speedup. It might even slow down the site (slightly) for logged in users.

Hello! Thanks for a great plugin! I’m having an issue with the plugin caching some of my template files, even though I have included them in the ‘Do not cache’ section. For example, I have a template file, home.php, that is being displayed on my root/index page /. However, this page is still being cached. Is there some PHP I can put in my template file that will prevent it from being cached? Thanks.

Thanks for the great plugin Donncha!
I’ve using this nice plugin since 0.6.7 and running without problem.

But after upgraded to 0.8/0.8.1, my site is facing a problem that when an new post is made or an old post is edited, all cached and expired files for posts/tags/categories/paged under WP Cache and WP Super Cache were deleted (folders remain here but html files inside are deleted, the cache of pages remain here).

Is it the design of 0.8 that all posts/tags/categories/paged would delete when post change? Or just for that specific post, related tags and categories to be deleted when post change?

Since my site is quite busy site, so if every time make an new post or edit an old post would cause all cached and expired files clear, the server loading would increase rapidly.

So just want to check if it’s the problem on my own or it’s the original design of 0.8.

Brian – Did you enable the “clear all cache when post is edited” option? Unfortunately you can’t turn that off unless you edit wp-content/wp-cache-config.php
Also I discovered that the “edit_post” action is activated when a comment is left, thus clearing the cache as well which is definitely not what we want to happen!

The newest version follows more closely what wp-cache does – it deletes the cache file for the post plus deletes some other “non post” pages that seem to be related, although from testing they’re not always so.

I didn’t enable the “clear all cache when post is editedâ€. So there is no $wp_cache_clear_on_post_edit in my wp-content/wp-cache-config.php

With the concept you explained, may be I know what is happening to me… Most of my posts (95%) didn’t fill with content, instead numerous custom field values (metadata). As a result, those posts didn’t fill with content are considered as related, thus when a post is edited or made, nearly all of my cached and expired files are deleted. It is correct for my case?

I have been using wp-super-cache for quite a while on several sites and really like it, but with version 0.8.4 on one of my sites (http://www.northcarolinagenealogy.net) it seems to be throwing up a 403 Forbidden that says

Forbidden
You don’t have permission to access /wp-content/cache/supercache/www.northcarolinagenealogy.net//index.html on this server.
Apache/2.0.52 (Red Hat) Server at http://www.northcarolinagenealogy.net Port 80

I checked the file permissions and there is no index.html file. This is with the .htaccess rules added to the .htaccess file. If I take out and use the wordpress default .htaccess all works. If I’m logged in I don’t have any issue.

Strangely I don’t seem to have the same problem with the other sites I use it on (same version of super cache). Clearing the cache works for the first dynamic page load, but the second fails with the same forbidden error.

The Golden Compass
First of a three part fantasy/sci-fi series. Some people hate it because of it's anti God message but it's a great read. I found it hard to put down. There's even a Snopes article about the film adaptation.

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.