Add expires header, help please


#1

Hi I checked my website in gmetrix, the results say add expires header
Could you help me please how to fix, thanks
See bellow:
There are 3 static components without a far-future expiration date.
https://ajax.cloudflare.com/cdn-cgi/scripts/935cb224/cloudflare-static/rocket.min.js


https://www.google-analytics.com/analytics.js


#2

None of those are under your account’s control, so you’re kind of stuck with the headers they offer. At least, I’m pretty sure of that. Especially the google-analytics one. Google’s short expirations always trip up my performance scores.


#3

Hi What’s mean isn’t in my account control, could you explain better please? Thanks


#4

The resource you’re listing comes with its own headers.

  1. rocket.min.js is served from a domain that isn’t yours.
  2. email-decode.min.js is from pulled from Cloudflare’s cdn-cgi scripts library…not from your web server
  3. analytics.js is served from Google, so you can’t change their headers, either.

You can’t change their cache expires time. You could minimize the impact, though:

  1. Turn off Rocket Loader from the Cloudflare Speed settings page.
  2. Turn off Email Address Obfuscation in the Cloudflare Scrape Shield settings page.
  3. Stop using Google Analytics. Or keep using it and live with the cache expires time. This one isn’t that big of a deal because a) Google’s pretty darned fast, and b) GTMetrix is making a bigger deal about cache expires headers than is really necessary in cases such as these.

#5

This topic was automatically closed after 14 days. New replies are no longer allowed.