Reputation: 1462
I used this google tool to analyze my site. https://developers.google.com/speed/pagespeed/insights/
The results of this tell me the following:
**Leverage browser caching**
Setting an expiry date or a maximum age in the HTTP headers for static resources instructs the browser to load previously downloaded resources from local disk rather than over the network.
Leverage browser caching for the following cacheable resources:
https://www.googletagmanager.com/gtm.js?id=GTM-XXw3 (15 minutes)
https://connect.facebook.net/en_US/fbevents.js (20 minutes)
https://connect.facebook.net/…onfig/1510218389239357?v=2.8.17&r=stable (20 minutes)
https://connect.facebook.net/…config/253358141816050?v=2.8.17&r=stable (20 minutes)
https://bat.bing.com/bat.js (30 minutes)
https://www.google-analytics.com/plugins/ua/linkid.js (60 minutes)
https://www.googleadservices.com/pagead/conversion_async.js (60 minutes)
https://www.google-analytics.com/analytics.js (2 hours)
I am using Wordpress. Where/how do i set the expiration?
Upvotes: 0
Views: 449
Reputation: 13840
Short Answer: You can't modify the cache settings on these particular scripts.
Longer Answer: There are a few plugins like WP Hummingbird or Autoptimize that can help you with browser cache settings, as well as the script_loader_tag
hook.
However, with that said, note the URLs on these files. These are on GTM, Facebook, Bing, and a few Google sites. You can't control the expiration on these, as they're being loaded in remotely from external tools with your tracking/analytics scripts or iframes.
These results are ones you'll have to live with, as it's not worth hosting them yourself and modifying the tracking codes just to adjust the cache expiration on them.
Upvotes: 2