W3 Total Cache
AdRotate solution (5 posts)

  1. aljuk
    Posted 4 years ago #

    I'm posting this for the benefit of anyone, like me, who runs into problems using page caching with w3tc and an ad banner randomiser like AdRotate.

    I tried all the solutions mooted on previous forum posts, like fragmented caching (wrapping the call to AdRotate in special tags to exclude it from caching) but none of it worked for me - the ads were always cached.

    This, however, works, and is oh so simple.

    Simply remove the call to AdRotate (e.g. <?php echo adrotate_block(1) ?>) from your template file, place it into its own (new) file, and call it into the template via a php include instead. Then add this new file to the 'Never cache the following pages:' list in w3tc. Clear all caches and you should be good to go.


  2. shansta
    Posted 4 years ago #

    Hey, I have tried this... Seems to work well with adsense but still caching other advertisers when using <img> tags :/

  3. aljuk
    Posted 4 years ago #

    Ah, tbh I'm only serving ads locally at this point, off my own server (the output of which is randomising fine), so have no experience of that at this time. But I'd have thought it should be fine since the same principle should apply (ie. that the scripts are running live and not cached). Hmm, perhaps my theory has a flaw.

  4. Frederick Townes
    Plugin Author

    Posted 4 years ago #

    It's best to deliver them with openx or any other javascript based delivery system.

  5. lin
    Posted 3 years ago #

    Hello folks. I had the same problem with W3 Total Cache and AdRotate. I wrote a blog entry on my blog with the solution: "How To use the Banner-Plugin AdRotate together with W3 Total Cache's Page-Cache (W3TC)"



Topic Closed

This topic has been closed to new replies.

About this Plugin

  • W3 Total Cache
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic