• Hi, I’ trying to use fragmented cache, but I’m having a problem.

    I’ve set this in wp-config.php:
    define('W3TC_DYNAMIC_SECURITY', 'foobar' );

    And this in header.php:
    <!-- mfunc foobar --> echo rand(, 100); <!-- /mfunc foobar -->

    It loads the random number the first go, but on reloading the page, where the number should be is blank. I’ve found that when I uncheck Enable HTTP (gzip) compression under HTML & XML in Browser Cache, it loads but, slow and completely uncached. Is there any solution to this?

    https://wordpress.org/plugins/w3-total-cache/

Viewing 2 replies - 1 through 2 (of 2 total)
  • I think you are observing the fragment being cached after the first load, and thus the mfunc does not display anything as you have not specified both the cached and uncached output (it assumes you only want to display the function when uncached).

    Of course, AFAIK, it shouldn’t be caching anyway given what the mfunc is supposed to be doing! Make sure Page caching -> basic and LAte Init is enabled, but I’m still having this problem with all of the above checked off. 🙁

    Ok – weird breakthrough.

    I tried completely excluding the page templates with fragment caching active (all or nothing). The message at the bottom of the pages says it is still being cached, but the fragment section is NOT being cached… which is what I wanted.

    What I’m not sure about is whether the W3TC message at the bottom of the page is a bundle of feelthy liez, or whether something about trying to exclude the page has actually got the fragment cache working. Pass.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘mfunc code blank on second load’ is closed to new replies.