: Can .htaccess be used to cache AdSense JavaScript to improve the pagespeed score? I'm AdSense publisher and I need to improve the page speed score for my site. It already gets 90/100 for speed
I'm AdSense publisher and I need to improve the page speed score for my site. It already gets 90/100 for speed and 100/100 for User Experience, however Google AdSense code is preventing it from getting the full 100/100
This is the error:
Leverage browser caching for the following cacheable resources: pagead2.googlesyndication.com/pagead/js/adsbygoogle.js (60 minutes) pagead2.googlesyndication.com/pagead/osd.js (60 minutes)
My questions:
Can I cache adsbygoogle.js and osd.js for longer using .htaccess?
will it effect my AdSense revenue? I won't sacrifice my revenue for higher score.
How much longer should I cache it? 1 day? 1 week?
Google encourages me to improve my web page speed, but it seems like the only way to achieve 100/100 is to get rid of Google AdSense.
More posts by @Gloria169
1 Comments
Sorted by latest first Latest Oldest Best
adsbygoogle.js and osd.js are third party JavaScript files. Your server isn't the one that sends them to users, so you have no control over their caching. .htaccess will be of no help in this situation.
The page speed recommendations are just that: recommendations. They are not hard and fast rules. There are times that you want to break the rules. In this case, AdSense doesn't allow those files to be cached because doing so might show the same ads to the same user. AdSense wants control over exactly which ads a user sees for each pageview.
So you are correct. If you want a perfect page speed score, you have to ditch AdSense.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.