Seoxpert.io
lowPerformance

Hashed Static Assets Missing Aggressive `Cache-Control`

Hashed static assets lack aggressive Cache-Control headers, preventing optimal browser caching for repeat visits.

By Seoxpert Editorial · Published

Why it matters

Without aggressive caching, browsers re-request fingerprinted assets even though their content never changes. This increases load times and server load, especially hurting repeat visitors and mobile users. Proper caching improves site speed and user experience, which can positively impact SEO.

Impact

Leaving this unresolved causes unnecessary network requests and slower repeat page loads.

How it's detected

An automated crawler checks fingerprinted asset URLs for the presence of strong Cache-Control headers (max-age ≥ 31536000, immutable).

Common causes

  • CDN or proxy overrides default Cache-Control headers
  • Static server misconfiguration for hashed asset paths
  • Lack of pattern-based rules for fingerprinted filenames
  • Custom build pipelines not updating server config

How to fix it

Configure your server or CDN to serve hashed/fingerprinted static assets with 'Cache-Control: public, max-age=31536000, immutable'. For frameworks like Next.js, verify that proxies or CDNs are not overriding these headers. Use pattern matching in your server config to target files with hashes in their names (e.g., app.[hash].js).

Code examples

Nginx: Aggressive Cache-Control for Hashed Assets

location ~* \.[0-9a-f]{8,}\.(js|css)$ {
    add_header Cache-Control "public, max-age=31536000, immutable";
}

Apache: Aggressive Cache-Control for Hashed Assets

<FilesMatch "\.[0-9a-f]{8,}\.(js|css)$">
    Header set Cache-Control "public, max-age=31536000, immutable"
</FilesMatch>

FAQ

Why do hashed static assets need aggressive Cache-Control headers?

Because their URLs change when the content changes, so they can be cached indefinitely without risk of serving stale content.

What does the 'immutable' directive do in Cache-Control?

It tells browsers that the resource will never change, so they don't need to revalidate it as long as the URL matches.

How do I configure aggressive caching for hashed assets behind a CDN?

Set rules in your CDN to match hashed filenames and apply 'Cache-Control: public, max-age=31536000, immutable' to those responses.

What if my hashed assets are still missing the correct headers after configuring my app?

A proxy or CDN may be overriding your headers. Check all layers serving your assets and ensure they preserve or set the correct Cache-Control.

Found this issue on your site?

Run a scan to see if Hashed Static Assets Missing Aggressive `Cache-Control` affects your pages.

Scan my website →