Skip to content
Speed and performance · free, no sign-up

JavaScript Caching Checker

Reads the caching headers of a page's scripts and flags those kept for under 7 days.

Why it matters

Scripts are often the heaviest text files on a page. If they are not cached, phones download and process them all over again on each visit.

How to fix it

  • Send Cache-Control: max-age=31536000 for your own scripts.
  • Use versioned file names, so updates still arrive.
  • You can't change the caching of other companies' scripts, which is one more reason to keep them few.

What a good result looks like

Your own scripts are cached for at least 7 days, so returning visitors don't download them again.

Common mistakes

  • Using no-cache on every script out of fear of serving old code, when versioned file names solve that.
  • Forgetting that scripts added by a CDN or tag manager follow their owners' rules.

Questions about the JavaScript Caching Checker

Why is Google Analytics cached for so little time?

Google keeps it short so it can update the script quickly. That is its choice, not a fault in your site, so it doesn't decide the verdict here.

Does caching help first-time visitors?

No, only people coming back or moving to another page that uses the same files. It matters most on sites where people view several pages.

Check everything at once

Run our other instant checks on your site in one report.

Full SEO check-up

More speed and performance tools