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 is to figure out a solution with your CDN provider. For Cloudflare you can read more about when ETag is removed here.

Still need help? Contact Us Contact Us