Support » Plugin: W3 Total Cache » [Plugin: W3 Total Cache] Prevent plugin data from getting cached ?

  • Resolved kettlewell


    I’m creating a homebrew ad manager plugin for multisite that has a weighted random ad serving routine… I’m afraid that it’s going to get cached, and kill the randomness…

    Are there any special things that I can design into the plugin that will prevent that aspect from getting cached?

    I’m currently using a CDN (CloudFront) with object, page and DB caching going to disk on a tmpfs fileshare…

    Any advice would be warmly welcomed.



Viewing 2 replies - 1 through 2 (of 2 total)
  • What you’re looking for is fragment caching – you just have to surround the code you want to not be cached with mfunc or mclude tags. Alternatively, you could use javascript or iframes.

    If you use fragment caching, though, you can’t use Enhanced caching. Since you’re using DB Caching, I assume you’re on a VPS or dedicated server, so other page caching options might be available for you, and I’m not sure whether they will work with these dynamic tags or not. You can always try them. If they don’t work, what will happen is the whole page will just not get cached, so your best bet is to try it out. Basic caching might give you enough benefit, anyway.

    Edit your templates to with the following syntax to ensure that dynamic features remain so:

    Example 1:
    <!– mfunc any PHP code –><!– /mfunc –>
    Example 2:
    <!– mfunc –>any PHP code<!– /mfunc –>
    Example 3:
    <!–MFUNC –>
    echo rand();
    <!–/mfunc –>
    Example 4:
    <!– mclude path/to/file.php –><!– /mclude –>
    Example 5:
    <!– mclude –>path/to/file.php<!– /mclude –>

    Excellent –

    This is what I was looking for…I knew I’d seen it some where before but was at a loss.

    Thanks so much – looks like it’s installed and working 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: W3 Total Cache] Prevent plugin data from getting cached ?’ is closed to new replies.