WordPress.org

Ready to get started?Download WordPress

Forums

W3 Total Cache And Widgets With Javascript (11 posts)

  1. cfisher
    Member
    Posted 3 years ago #

    Does W3 Total Cache cache widgets with javascript? I've looked everywhere and cannot find answer to this. I use Googe Ad Manager which provides javascripts that I place in widgets to display ads. I cannot have W3 Total Cache cache these else my sold ad impressions wouldn't be counted correctly.

    Thanks!!
    Chris

  2. Pascal Dreissen
    Member
    Posted 3 years ago #

    I think Frederick knows the best answer, but my guess would be that you need to use fragmented cache (see the faq in the plugin how to use it). On the other hand the javascript portion would make an external request which is not cached afaik !

  3. cfisher
    Member
    Posted 3 years ago #

    Thanks for your response. That would great if it doesn't cache the javascript external request. The javascript code does not change and could be cached if it could still make its external call to Google Ad Manager which would then output the appropriate ad. I will be curious to see what Frederick has to say.

    Thanks!

  4. cfisher
    Member
    Posted 3 years ago #

    Frederick - if you are out there and can answer this question, I would greatly appreciate it. I want to implement W3 Total Cache but need to make sure it will not affect by ad impressions as described above. Thanks!! Chris

  5. Frederick Townes
    Member
    Posted 3 years ago #

    Do not minify ad (adsense etc), statistics or analytics tracking code. So do not minify your DoubleClick for Publishers (Google Ad Manager) JS code. There is simply no benefit to doing this based on how these services currently work unless you know exactly what you are doing. Enabling page caching will cache entire page output created by WordPress (widgets ad all), it will not break your existing scripts by itself.

  6. cfisher
    Member
    Posted 3 years ago #

    I won't minify what you referenced. Thanks for that.

    So sorry, but I am having trouble understanding your last statement because of my own ignorance:

    You said, "Enabling page caching will cache entire page output created by WordPress (widgets ad all), it will not break your existing scripts by itself."

    Does your statement mean that W3 Total Cache will actually cache the external calls (and not just the JS code) and thus affect the number of impressions in DoubleClick for Publishers?

    Thanks so much for your response. I really appreciate it.

  7. Frederick Townes
    Member
    Posted 3 years ago #

    No, I meant that whatever WordPress returns when you request a page is what the page cache contains. Your ad code is powered by JavaScript so it matters not if the page is cached JavaScript is run just the same.

  8. cfisher
    Member
    Posted 3 years ago #

    OK. Thanks. So it sounds like it does cache the actual advertisements. This won't work for me. I sell ads based on number of impressions and if they are cached it will significantly reduce the actual impression count.

    I know there are tons of website using W3 Total Cache with advertisement managers. I would greatly appreciate it if anyone out there could help out and explain how you use W3 Total Cache on a site that serves advertisements based on live impression counts.

    Thanks,
    Chris

  9. Frederick Townes
    Member
    Posted 3 years ago #

    That's exactly the opposite of what I said. Ads are served by JavaScript, nothing is caching those. Page caching doesn't affect impressions, if it did caching wouldn't be usable for most of the sites on the web.

    The fact is you need page caching to get more impressions out of your server without increasing hardware. I don't know how to be more clear, that basically everything you're worried about is a non-issue because W3TC doesn't affect those things unless you change default settings to create that problem.

  10. cfisher
    Member
    Posted 3 years ago #

    Hehe. Thanks Frederick for your patience and further elaboration. Your last explanation was very clear to me now. My apologies for the lack of earlier understanding. I plan to implement W3 Total Cache with a CDN very soon now that I know it will work! Thanks!!

    Chris

  11. Frederick Townes
    Member
    Posted 3 years ago #

    You're welcome.

Topic Closed

This topic has been closed to new replies.

About this Topic