Seoxpert.io
lowBest Practices

Pages Missing Cache-Control Headers

Pages are missing Cache-Control or Expires headers, preventing browsers from caching them efficiently.

By Seoxpert Editorial · Published

Why it matters

Without Cache-Control headers, browsers must re-download pages and assets on every visit, increasing load times and bandwidth usage. This can negatively impact user experience and may indirectly affect SEO by slowing down your site.

Impact

Leaving this unresolved results in slower repeat visits and unnecessary server load.

How it's detected

An automated crawler checks HTTP responses for the presence of Cache-Control or Expires headers on each page.

Common causes

  • Web server not configured to send Cache-Control headers
  • CDN settings not specifying cache behavior
  • Application code omitting cache headers for dynamic pages
  • Static assets served without explicit caching policy

How to fix it

Configure your web server or CDN to set appropriate Cache-Control headers. For HTML pages, use 'Cache-Control: no-cache' to allow caching with revalidation. For static assets like images, CSS, and JS, use 'Cache-Control: public, max-age=31536000' to enable long-term caching. Update your server or application configuration files accordingly.

Code examples

Apache: Add Cache-Control for HTML and static assets

# For HTML pages
<FilesMatch "\.html$">
  Header set Cache-Control "no-cache"
</FilesMatch>

# For static assets
<FilesMatch "\.(js|css|png|jpg|gif|svg)$">
  Header set Cache-Control "public, max-age=31536000"
</FilesMatch>

Nginx: Add Cache-Control for HTML and static assets

# For HTML pages
location ~* \.html$ {
  add_header Cache-Control "no-cache";
}

# For static assets
location ~* \.(js|css|png|jpg|gif|svg)$ {
  add_header Cache-Control "public, max-age=31536000";
}

FAQ

Do all pages need the same Cache-Control header?

No. HTML pages typically use 'no-cache', while static assets should use 'public, max-age=31536000'.

Will adding Cache-Control headers affect how often my content updates?

Correctly set headers allow browsers to cache content but revalidate when needed, ensuring users see updated content.

Can I set Cache-Control headers using my CDN?

Yes, most CDNs allow you to configure Cache-Control headers for different content types.

Is it necessary to set both Cache-Control and Expires headers?

Setting Cache-Control is usually sufficient, as it is more flexible and widely supported.

Found this issue on your site?

Run a scan to see if Pages Missing Cache-Control Headers affects your pages.

Scan my website →