Cache headers are configured

low

cache_headers

Checks that cache headers are properly configured.

What does this rule check?

HTTP cache headers (Cache-Control, ETag, Expires) tell browsers and CDNs how long to cache resources. Proper caching avoids redundant downloads on repeat visits.

Why is this important?

Without cache headers, browsers re-download all resources on every visit, wasting bandwidth and slowing repeat page loads. Good caching can make repeat visits nearly instant.

How to fix

Set appropriate Cache-Control headers. Use long cache times for static assets with versioned filenames. Use short cache or no-cache for dynamic content.

Examples

Incorrect
Cache-Control: no-store
<!-- Even static assets never cached -->
Correct
Cache-Control: public, max-age=31536000, immutable
<!-- Static assets cached for 1 year -->

Agent fix snippet

Copy this snippet and paste it into your AI coding agent to fix this issue automatically.

Configure cache headers:
- Static assets (JS/CSS/images): Cache-Control: public, max-age=31536000
- HTML pages: Cache-Control: public, max-age=0, must-revalidate
- API responses: Cache-Control: private, no-cache