Cache of edited post not updated
-
I just edited a post and then checked it, but the change wasn’t there. Only after turning down the wp-cache expiry to 60 seconds did the change show up (after I waited a minute).
Isn’t an editorial change supposed to update the cache? Perhaps only the wp-super-cache was changed (I didn’t check that).
-
No, that line tells browsers that what they are getting is encoded as UTF-8
See. https://en.wikipedia.org/wiki/Character_encodings#Popular_character_encodings
Unfortunately there’s two ways to encode a file as UTF-8.
One has what’s called a Byte Order Mark at the start while the other does not.If your text editor supports UTF-8 BOM encoding, you’ll never see the BOM. The problem is that if one or more of your PHP files has a BOM there’s actually the 3 characters ??? before the opening php tag and it makes supercache go crazy.
I guess how you find and fix it depends on what OS you have and what text editor you normally use.
Of course, the problem could be something else, but I shot myself in the foot with a UTF-8 BOM a few weeks ago – It looks very familiar.
It could also be the gzip compression option. Some setups don’t like that option. Turn it off.
Murmatron 2 – Thanks for the information. I’m on OS X and using ‘Taco HTML edit’ (I hand code all I do). I’m not seeing any characters in the theme files before the opening PHP tag. I’m guessing Taco supports UTF-8, so is there an editor on OS X that I would be able to see these characters.
Otto42 – I thought the gzip could be the problem (just an inkling!) However with supercache not working for me I’m on the ‘half-on’ setting which doesn’t seem to allow you to switch off the gzip compression.
Thank you both for your time helping me out here ??
Using OS X, finding files with BOMs shouldn’t be a problem…
cd /the/path/to/your/wordpress/wp-content grep -r --include=*.php -P "\xEF\xBB\xBF" *
That should scan all the PHP files in your plugins and themes and list any that require attention.
As for OSX text editors – I’m afraid I know nothing.
Murmatron 2 – sorry, I’m not sure where I put that text to scan my php files?
I am having the same problem as huckmag.
Generally, both the WP-Cache and WP-Super Cache work very well – the caching and everything else works and is fabulous.
However, when I edit a post as an administrator or have anyone write a comment for a post, the supercache for that post does not get expired and refreshed. So users who are not logged in or never left a comment will still get the old supercached copy of the post.
I have physically verified the files in /wp-content/cache/supercache directories and confirmed that the index.html files for each post do not get updated even after an edit or new comment.
I have ruled out plugins, because I disabled all plugins except for Akismet and WP-Super Cache and the problem still persists.
I have ruled out themes, because I switched to one of the two plain vanilla wordpress default themes, and the problem still persists. (I’m using K2 normally, BTW)
Everytime I do the test I always clear my cache and verify in /wp-content/cache/ that the files are indeed deleted.
I’m running WordPress 2.6.2 on Host Gator and my PHP info is here:
https://armchairtheorist.com/public/phpinfo.php
For the time being, I’m switching to HALF-ON mode, but is there something else that I can try to help and troubleshoot this?
Would really like to get this otherwise awesome plugin to work fully.
Updating WP Super Cache to version 0.8 has solved the problem of the files not updating.
https://ocaoimh.ie/2008/09/23/wp-super-cache-08/
I <3 WP Super Cache again!
I think I might’ve spoken to soon.
I’d updated to 0.8 and everything worked perfectly but an upgrade to 0.8.2 and the problem is back.
However this time blog entries are fine (single.php) but category index pages are not updated.
I’m getting this error when I try and deactivate the plugin…
Warning: unlink(/hsphere/local/home/huckftp/huckmagazine.com/wordpress/wp-content/wp-cache-config.php): Permission denied in /hsphere/local/home/huckftp/huckmagazine.com/wordpress/wp-content/plugins/wp-super-cache/wp-cache.php on line 88 Warning: unlink(/hsphere/local/home/huckftp/huckmagazine.com/wordpress/wp-content/advanced-cache.php): Permission denied in /hsphere/local/home/huckftp/huckmagazine.com/wordpress/wp-content/plugins/wp-super-cache/wp-cache.php on line 88 Warning: Cannot modify header information - headers already sent by (output started at /hsphere/local/home/huckftp/huckmagazine.com/wordpress/wp-content/plugins/wp-super-cache/wp-cache.php:88) in /hsphere/local/home/huckftp/huckmagazine.com/wordpress/wp-includes/pluggable.php on line 770
huckmag – did you try the “Clear all cache when publishing” checkbox? That will do what you want. 0.8 was basically doing that anyway which is why you saw the category pages update.
Donncha – thanks for your response.
I’ve tried your fix and it works. It does however slow down the time it takes to post but I guess that’s a price worth paying for the massive speed increase the end user gets from super cached pages.
As a side note do you have idea why I would get the above error when uninstalling the plugin?
It can’t delete those two files when it tries to do so (to turn off the cache, those two files must be deleted/unlinked). This is probably because of permissions. Make sure those two files are 775.
So now I the “Clear all cache when publishing” checkbox seems to randomly uncheck itself. Often after posting I’ll go in to settings > wp-super cache and the box is no longer selected.
I’m not sure this saga will ever end!
huckmag – Is that with 0.8.2? I can’t replicate the “clear all cache” checkbox unchecking. Can you debug it? Look in wp-cache.php at the wp_cache_manager() function. Around line 234 add this:
error_log( “wp_cache_clear_on_post_edit: $wp_cache_clear_on_post_edit\n” );
That will dump the value of the checkbox to your php_errors file. Check that if the box unchecks itself again. Look up the php manual for error_log() to find out how to send the error to another file, or you could use mail() too.
Yep it’s with 0.8.2
I will debug this asap. One way you can replicate the unticking is by pressing ‘update compression’. That unticks the box for me.
- The topic ‘Cache of edited post not updated’ is closed to new replies.