• Hi,

    I’m using your great plugin and it pushes my sites to their best speeds.
    BUT! I’ve now built a site with a posts slider showing random posts by each page load, and when using page cache – it won’t randomize.

    My only solution was to tell W3 not to page cache the frontpage.

    Is there any way to tell W3 not to cache the specific area/js/plugin?

    TIA.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor gidomanders

    (@gidomanders)

    You could use Page Cache Disk: Basic in combination with Fragment Cache to allow dynamic content like that.

    Thread Starter wpkiller

    (@wpkiller)

    @gidomanders, thank you.
    Is fragment cache only available with the PRO version?

    @wpkiller ,

    Page Fragment Caching will work just fine with the free version (pro version not needed). It’s been a while since i played with it but you simply make use of the mfunc macro in your php code in Disk: Basic mode.

    To save me time in giving you a step-by-step, here is an old, but still relevant article which gets it working.

    You may have noticed the disabled “Fragment Cache” extension under the Extensions area (reason for your last reply)? As far as i know, this is not the same as Page Fragment Caching. Confusing, huh? 🙂 Unfortunate naming convention by w3tc, is my guess. The Fragment Cache extension seems to be a more nuanced object cacher, whereby you can give things like a theme’s transient ID, so it can cache that object call to disk. It’s not relevant for your problem.

    Page fragment caching, on the other hand, simply let’s w3tc know not to cache a segment of output on an existing (disk) cached page so when a visitor hits that page, before returning it, w3tc looks through this page for its special fragment cache marker (mfunc). If it finds it, it runs the php code found within that segment(s), then replaces that section with the code output results. And lastly, it sends the final output page back to the visitor. This happens for every visit.

    Disk: Basic is required because it’s a cache method that wakes w3tc up to read an existing cached page from disk and perform any last second processing (if any is needed) before outputting to the visitor. Disk: Enhanced, on the other hand, takes a different approach by just cutting to the chase and outputting the cached page from disk right away without waking w3tc at all. Hence, why Disk: Enhanced is much faster than Disk: Basic, but why also Disk: Enhanced loses some extra flexible functionality like Page Fragment Caching.

    Thread Starter wpkiller

    (@wpkiller)

    Thank you, but I couldn’t make it work.
    Maybe it the time to say I’m not a full stack programmer, and this site was built with the aid of Elementor.

    So, after setting the wp-config.php and the page cache method, I’ve called an HTML widget which was calling a shortcode by php’s do_shortcode function, in between of mfunc and /mfunc. The widget was indeed called, but was still cached. 🙁

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Random posts slider with W3’s page cache’ is closed to new replies.