WordPress.org

Forums

Cache of edited post not updated (32 posts)

  1. ericr23
    Member
    Posted 7 years ago #

    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).

  2. Donncha O Caoimh
    Member
    Posted 7 years ago #

    Yes, the front page cache is cleared, and the cached file for that post is cleared.

    Next time you see this happen, can you confirm that a "supercache" file exists in wp-content/cache/supercache/hostname/path/to/your/post/index.html(.gz)

  3. huckmag
    Member
    Posted 7 years ago #

    Hi,

    I'm also suffering this problem since updating to the new version of wp-super-cache.

    It seems that to not be a problem when I just have the plugin half on (or am logged in to WP).

    However when pages are super-cached changes do not show up any more when editing or posting.

    I have wp-super-cache set up to the default settings, with everything caching fine.

  4. ericr23
    Member
    Posted 7 years ago #

    I had removed wp-cron.php until I got wp-super-cache working, because of wp-cron's heavy use of the shared server CPU.

    Since restoring wp-cron.php, the edited files are indeed updated.

  5. huckmag
    Member
    Posted 7 years ago #

    Still no luck for me (not quite sure what you did Ericr23? Delete the wp-cron.php then upload it again?)

  6. Donncha O Caoimh
    Member
    Posted 7 years ago #

    huckmag - can you confirm if there is an actual cache file at wp-content/cache/supercache/(hostname)/index.html when you see the problem with updating? Does that file have the updated or new post?

    ericr23 - wp-cron shouldn't be heavy on the CPU, it's probably a plugin that uses the cron facility.

  7. huckmag
    Member
    Posted 7 years ago #

    donncha - I checked a random blog post in the supercache folder and - there the file is there all fine but it's not being updated when I edit a post.

  8. huckmag
    Member
    Posted 7 years ago #

    This is also happening on a seperate install that I have on another hosting company (meditemple).

  9. Clear the cache entirely and make sure that your .htaccess rules match what the super cache says that they should be.

    Then see if it's being cleared properly. It's possible that the upgrade shifted things around a bit, so starting with it clear is the best way to diagnose the problem.

  10. huckmag
    Member
    Posted 7 years ago #

    Otto42
    I've done a complete clear of the cache to no avail.

    If I post a new entry, the entry will not show up anywhere on the super cached pages but if I put in the permalink url I can view the page and the page will then be super cached.

    Edits posts however do not show at all. Really frustrating!

    Having the plugin 'half-on' does get round the problem but I'd love to have the sites super cached.

  11. huckmag
    Member
    Posted 7 years ago #

    Also the .htaccess rules are exactly what was given by super cache.

  12. Well, I have to say that something is buggered with your site in specific then, because that certainly doesn't happen to me. When I edit, the changes show up right away, the cache clears correctly, etc. Everything appears to work fine for me.

  13. huckmag
    Member
    Posted 6 years ago #

    Otto42 - yeah I think so too. The weird thing is it's happening on two separate installs on wordpress I have on two completely different sites (and hosting companies).

  14. huckmag
    Member
    Posted 6 years ago #

    Just to add to my woes I'm still getting my blog turned into this unintelligible text...

    http://www.huckmagazine.com/images/screenshot.png

    Is this something known with wp-super-cache? It does it when I have it 'half on' as well.

    argh!

  15. Murmatron 2
    Member
    Posted 6 years ago #

    The screen-shot looks like one of your theme files (or plugin files) is saved as UTF-8 with BOM

  16. huckmag
    Member
    Posted 6 years ago #

    Murmatron 2 - I'm not sure exactly what you mean by "saved as UTF-8 with BOM" - could you explain please?

    In my header.php I found this...
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    Is this where the problem lies?

  17. Murmatron 2
    Member
    Posted 6 years ago #

    No, that line tells browsers that what they are getting is encoded as UTF-8

    See. http://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.

  18. It could also be the gzip compression option. Some setups don't like that option. Turn it off.

  19. huckmag
    Member
    Posted 6 years ago #

    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 :)

  20. Murmatron 2
    Member
    Posted 6 years ago #

    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.

  21. huckmag
    Member
    Posted 6 years ago #

    Murmatron 2 - sorry, I'm not sure where I put that text to scan my php files?

  22. armchairtheorist
    Member
    Posted 6 years ago #

    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:

    http://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.

  23. huckmag
    Member
    Posted 6 years ago #

    Updating WP Super Cache to version 0.8 has solved the problem of the files not updating.

    http://ocaoimh.ie/2008/09/23/wp-super-cache-08/

    I <3 WP Super Cache again!

  24. huckmag
    Member
    Posted 6 years ago #

    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.

  25. huckmag
    Member
    Posted 6 years ago #

    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
  26. Donncha O Caoimh
    Member
    Posted 6 years ago #

    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.

  27. huckmag
    Member
    Posted 6 years ago #

    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?

  28. 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.

  29. huckmag
    Member
    Posted 6 years ago #

    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!

  30. Donncha O Caoimh
    Member
    Posted 6 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic