Support » Plugin: WP Super Cache » [Plugin: WP Super Cache] Dynamic Cache not working

  • Wp Super Cache works great until I add the following to my head.php file:


    Now when I test the cache I get the following message:

    The pages do not match! Timestamps differ or were not found!

    And the pages on my site are blank.

    The function I am trying to call is in my functions.php file. The following works with WP Super Cache turned off:

    function youAreHere($postid){ //This creates the breadcrumb
    if(function_exists('zg_recently_viewed') && isset($_COOKIE["WP-LastViewedPosts"])){
    $crumb = zg_recently_viewed($postid);
    }else if(function_exists('bcn_display')){
    $crumb = '<p class="breadcrumb">You Are Here:  '.bcn_display().'</p>';
    return $crumb;

    I’m using PHP to cache.

    Is there a better javascript solution to call the php using $post->ID where I can use mod_rewrite?

    Mahalo for the help.

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author Donncha O Caoimh


    Enable “Late init” on the advanced settings page. There’s a FAQ about it in the documentation.

    Same here … I Get
    <!– File not cached! Super Cache Couldn’t write to: ” full path … ” –>
    In debug I see that the files couldn’t write to /wp-content/cache/supercache
    After delete of this folder it isn’t rebuilding again .. Or after making this folder right with permissions it’s also giving the error .
    Switching php or mod_rewrite makes no difference .. or Late init …


    Plugin Author Donncha O Caoimh


    anchel – your problem is different to the previous one. Unfortunately I can’t help as there’s a permission problem on your server.

    ok you say so … Have it on 4 blogs …

    Plugin Author Donncha O Caoimh


    Are the 4 blogs on the same host or server? You need to check the folders on your server, and check the modules loaded by your webserver. Maybe there’s some security module that will only allow PHP to write to files owned by the same owner. There are lots of reasons why you’re getting this problem unfortunately.

    Yes same host .. but it’s after upgrading to and if I delete cache folder in the wp-content .. the plugin creates a new folder cache with meta in it but no supercache folder …
    Thats strange ..

    Reinstalled and it’s back up and running …
    supercache folder is created and works fine ..

    sorry to say .. something in is broken ..

    Plugin Author Donncha O Caoimh


    Odd, that works fine for me and everyone who was testing the dev version. Grr.

    If you can, install the latest version on one of your blogs and try to debug around line 405. That’s the only chunk of code that changed between the two versions that might cause a problem for you. Thanks.

    Thanks for the help donncha. I tried what you said:

    1. Set $wp_super_cache_late_init to “1” in wp-content/wp-cache-config.php
    2. Enable “Late init” on the advanced settings page.

    And now I get this error when I test my home page:

    Parse error: syntax error, unexpected T_STRING in /home/gom/public_html/wp-content/plugins/wp-super-cache/wp-cache-phase1.php(204) : eval()’d code on line 96

    I also tried in Legacy mode and get the same error.

    If I use this bit of code instead:

    <!--mfunc youAreHere($post->ID); -->
    <?php youAreHere($post->ID); ?>

    The error goes away, but the pages are still blank.

    Plugin Author Donncha O Caoimh


    hawaiifi – look at the cached file and you might see the syntax error generated. You might need to use the debug file to find out what cache file to look for.

    Also, $post doesn’t exist when cached as the loop doesn’t run. 🙁 You’ll have to cache that somehow when the page is generated.

    $post->ID appears to be the culprit creating the error. I was able to solve this by echoing the commented lined using PHP like so:

    <?php echo '<!--mfunc youAreHere('.$post->ID.'); -->'; ?>

    But when a page is cached, my function is still not working. Do I need to make sure funtions.php is not cached? How would I do that?

    Should I just be using AJAX to call this function? It seems like that would allow me to turn off “Late init” and get things loading even faster.

    Plugin Author Donncha O Caoimh


    Yeah, ajax is better for this sort of thing!

    anchel – thanks for letting me into your server to investigate. The problem was that you had capital letters in your filesystem path and a unicode fix in .9 was to lowercase everything. I fixed this by lowercasing only the URI.

    To fix this on your other blogs grab wp-cache-phase1.php and copy it into wp-content/plugins/wp-super-cache/, overwriting the file of the same name there.

    Thanks for the fix! Great Job.

    Cheers from Holland.

    Speaking of Capital letters, it seems that super cache doesn’t care about capital letters in escape sequences. I have the following URI on my site:


    But sometimes, through stupid “normalization” by bots and clients, this becomes:


    This is cached as a separate instance by super cache.

    Not a big deal, but something that can’t easily be changed on the htaccess level.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘[Plugin: WP Super Cache] Dynamic Cache not working’ is closed to new replies.