Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I'm developing a page where I need to avoid JavaScript caching by browser. I've added this header:

<?php
header('Cache-Control: no-cache, no-store, must-revalidate');
header('Pragma: no-cache');
header('Expires: 0');
?>

After this, browsers didn't cache more JavaScript sorting out the issue, but in the same time I noticed a drop in Google AdSense RPM.

Then I removed the added code and now Google AdSense RPM is reaching again a good value.

So, how could I avoid JavaScript caching without meddle with AdSense performance?

share|improve this question
    
In normal circumstances caching of your JavaScript files should not make any difference in AdSense usage. Do you use some custom AdSense wrappers or Google defaults? Are you sure that all your js code is initializing properly when you activate caching? –  Tino Nov 4 '13 at 15:23
    
Are you adding these headers to all files, or just the javascript files? –  Stephen Ostermiller Nov 17 '13 at 19:27
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.