I receive "Serve static assets with an efficient cache policy" when testing with GTMetrix, why?

Sometimes, while running ShortPixel Adaptive Images or Autoptimize on your website you can notice this issue when running a GTmetrix or a PageSpeed Insights test:

This message, triggered by some URLs from cdn.shortpixel.ai, is completely normal. Here's what you need to know:

  1. If you see this message, it does not mean that your website is slow. You are just being told that your resources (images, CSS files, JS files...) should be cached in your visitor's browser for more than X days/months (decided by Google).
  2. The time ShortPixel tells the browser to cache the file is 365 days. That's the "Cache TTL" column seen on the screenshot. If you see something else that is not 365 days, it probably means that a third party is modifying that time (usually your CDN, see next point).
  3. Sometimes, other CDNs (e.g. Cloudflare) can have settings that will remove the Etag sent by ShortPixel, which will invalidate the Cache TTL set by ShortPixel. The solution needs to be figured out with your CDN provider. For Cloudflare you can read more about when Etag is removed here.
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us