Fragment caching not working
-
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; ?> –>
<?phpEven 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.
- The topic ‘Fragment caching not working’ is closed to new replies.