title: PageSpeed Insights 99/100 because of Google Analytics - How can I cache GA?
body: <p>I'm on a quest to reach 100/100 on PageSpeed and i'm almost there.  I'm trying to find a good solution to cache Google Analytics.  </p>
  
  <p>Here is the message I get:</p>
  
  <p>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:
  <a href="http://www.google-analytics.com/analytics.js" rel="noreferrer">http://www.google-analytics.com/analytics.js</a> (2 hours)</p>
  
  <p>The only solution i've found was from 2012 and I do not think it is a good solution.  Essentially you copy the GA code and host it yourself.  You then run a cron job to recheck Google once a day to grab the latest GA code and replace it.  </p>
  
  <p><a href="http://diywpblog.com/leverage-browser-cache-optimize-google-analytics/" rel="noreferrer">http://diywpblog.com/leverage-browser-cache-optimize-google-analytics/</a></p>
  
  <p>What else can I do to reach 100/100 while also using Google Analytics?</p>
  
  <p>Thank you.</p>