• We have some dynamic content on several pages on an otherwise static site. We’ve followed the instructions to exclude those code blocks from the page cache, which should cause them to be updated on each get request. However, the excluded code blocks are being cached along with the rest of the page. Configuration steps we took:

    1. Purchase the pro version. Apparently, fragment caching is now available only in the pro version.
    2. Set the page cache to Disk:Basic.
    3. Turn on late initialization under the Page Cache settings section.
    4. Added mfunc to ignored comment stems under HTML & XML minify settings
    5. Added this line to wpconfig: define( ‘W3TC_DYNAMIC_SECURITY’, ‘WIPDynContent’ );
    6. Added a date echo to the screen and wrapped in the mfunc comment to exclude it from caching, like this:

    ?>
    <!– mfunc <?php echo W3TC_DYNAMIC_SECURITY; ?> –>
    <?php
    $date = new DateTime();
    echo $date->format(‘Y-m-d H:i:s’) . “\n”;
    ?>
    <!– /mfunc <?php echo W3TC_DYNAMIC_SECURITY; ?> –>
    <?php

    Even using this simple example the html block is cached. Disabling w3 total cache allows the dynamic content to update, and shows that no other caching scheme is executing, only w3tc.

    I’ve seen several other posts raising this issue but no resolution.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Ben

    (@benbornschein)

    Hi David,

    if you really need fragment caching but can’t get it to work, I can recommend you my caching plugin [link redacted]. It also offers fragmented caching BUT it’s free. It works right out of the box, no complicated configuration required ??

    Thread Starter davidahlers

    (@davidahlers)

    Thanks Ben – we’ve done extensive testing with w3tc, and were hoping not to switch to another complete caching solution. Could we just use your plugin’s fragment caching and not have it conflict with w3tc’s page, minify, etc?

    Ben

    (@benbornschein)

    That is not possible ??
    It’s like antivirus software, you can’t have two at the same time ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Fragment caching not working’ is closed to new replies.