Updated on: December 2, 2026

clock 9 mins read

What Are Cache-Control Headers in WordPress and Why Do They Matter?

What Are Cache-Control Headers in WordPress and Why Do They Matter
Quick summary

This guide explains WordPress Cache-Control headers in plain words. You’ll learn what max-age, no-cache, no-store and private mean, which value fits which kind of file, and how to check what your own site sends. There are diagrams, a directive table and a checklist. The short answer: long cache times for files that never change, a quick check for pages, and no sharing for private content.

Same site two very different experiences
Same site two very different experiences

Ever noticed how a site feels instant on your second visit? That isn’t luck. Your browser kept a few files from last time, and one small line of text told it how long it was allowed to keep them.

That line is the Cache-Control header. Most site owners never look at it. Yet it quietly decides whether returning visitors re-download your logo, fonts and scripts, or just reuse what they have.

If you’ve ever seen a speed test say “Serve static assets with an efficient cache policy,” this is the thing it’s talking about. Let’s make WordPress Cache-Control headers simple.

What is a Cache-Control header?

It’s a note a server attaches to a file. The note says whether the file may be stored, by whom, and for how long it counts as fresh.

Think of the “best before” date on a carton of milk. The shop doesn’t need to ask the dairy each morning. It just reads the label. Browsers do the same with your files.

Here’s the journey of a single file, such as a stylesheet:

What is a Cache-Control header

On the wire it looks like this. Every response carries a few lines like these, and you can read them in your browser:

EXAMPLE RESPONSE HEADERS FOR A STYLESHEET

HTTP/1.1 200 OK

Content-Type: text/css

Cache-Control: max-age=31536000, immutable

“HTTP caching” is the umbrella name for all of this: browsers, CDNs, and proxies reusing responses. Cache-Control is how you steer it.

Why do WordPress Cache-Control headers matter?

They decide whether returning visitors get speed or repeat downloads.

Google’s Lighthouse audit says it plainly: HTTP caching can speed up page load time on repeat visits, because a cached file is read from the local copy instead of downloaded again. The audit flags fonts, images, media files, scripts and stylesheets that lack an efficient cache policy, and it even estimates the data you’d save.

They also protect people. A header can tell the world, “This page is private. Don’t keep it.” That’s how WordPress keeps logged-in pages out of shared caches.

And plenty of sites send nothing at all. A Fastly study of the May 2020 HTTP Archive crawl looked at 428.6 million requests from the top five million sites. Only 74.1% carried a Cache-Control header.

How many requests came with Cache-Control

Why is that a problem? MDN notes that if you leave the header off, caches are allowed to store the response using a guess, called heuristic caching, which can lead to unexpected results. Its advice: say what you want, clearly.

Statics

What do the Cache-Control directives mean?

A directive is one instruction inside the header. You can combine several with commas. Here’s the whole family in everyday language.

DirectiveWhat it meansTypical use
max-age=NFresh for N seconds. No need to ask the server during that time.Static files, long values
s-maxage=NSame as max-age, but only for shared caches like a CDN. Overrides max-age there.Different rules for CDN and browser
no-cacheMay be stored, but must be checked with the server before each reuse.HTML pages
no-storeDo not store this anywhere, in any cache.Sensitive pages
privateOnly the visitor’s own browser may keep it.Logged-in, personal pages
publicAny cache, including shared ones, may keep it.Shareable content
immutableThis file won’t change while fresh, so skip the check, even on reload.Versioned files
stale-while-revalidate=NServe the old copy for N more seconds while a new one is fetched in the background.Content that can be briefly old
must-revalidateOnce stale, always check with the server before reuse.Strict freshness needs
Watch out

The name no-cache fools almost everyone. It does not mean “don’t cache.” MDN is clear: the response can be stored, but it must be validated with the server before reuse. If you truly want nothing stored, use no-store.

Here’s how “fresh” works over time. This timeline shows a file with max-age=3600, which is one hour.

Mapping

Which Cache-Control value should each WordPress file use?

It depends on one question: does the file’s address change when the file changes?

If yes, the file is “versioned.” Both web.dev and MDN recommend a one-year max-age for these, because a new version gets a new address, so old copies are never reused. Many WordPress scripts and styles already carry a version number in the address, which makes them good candidates.

If no, you can’t promise the file stays the same. HTML pages are the classic case. Here, no-cache with validation (such as an ETag) lets the server answer “not modified” instead of resending the whole page. Web.dev says this is the best fit when a file must be checked before every use.

Same site two very different experiences-1

When in doubt, follow this flow.

What are WordPress cache exclusions and why do they exist

How does WordPress use Cache-Control headers?

WordPress sets some of them itself. Your server, caching plugin or CDN sets the rest.

The part WordPress controls is logged-in pages. In WordPress 6.3, the core team added the no-store and private directives to the Cache-Control header sent to logged-in users. The aim, according to the ticket, was to keep sensitive data from being cached and accessed by others. Visitors who aren’t logged in get a different header.

LOGGED-IN PAGE (SIMPLIFIED)

Cache-Control: …, no-store, private

Static files like images, scripts, and fonts are usually served straight by your web server. That’s why a plugin or your host has to add the long-lifetime rule. Without it, those files may go out with no clear instruction at all.

There’s a CDN angle too. If you use a CDN, s-maxage lets you give the CDN one rule and browsers another. And for personalized pages, MDN recommends private, so a shared cache never keeps a copy meant for one person.

Browser caching headers: Cache-Control vs Expires

You may also meet an older header called Expires. It gives an exact date and time when a file goes stale, instead of a number of seconds. Both belong to the family of browser caching headers, and many setups still send both.

When both appear, the newer max-age directive wins, because it’s easier to get right. A date can go wrong if a server clock is off. A countdown in seconds can’t. So if you’re writing new rules, reach for Cache-Control and treat Expires as a backup for very old software.

Searching for cache-control WordPress settings can feel confusing, because there’s no single switch in the dashboard. Core handles the logged-in case, and everything else comes from your host, your server or a plugin. That’s good news in a way: you only need to check it once, then leave it alone.

How can you check your own Cache-Control headers?

It takes about a minute, and you don’t need any tools beyond your browser.

How can you check your own Cache-Control headers

Measure twice, cut once.

— Carpenter’s proverb

Check a few types of file, not just one. Look at an image, a script, your font and the page itself. If a file has no Cache-Control line at all, that’s a sign to fix it.

You can also run thefree SpeedyGo speed test and look for cache-related advice in the results.

What are the most common Cache-Control mistakes?

One long lifetime on everything

A year on an HTML page means visitors may not see updates for a long time. Keep long lifetimes for files that are versioned.

Using no-store everywhere “to be safe”

It works, but it’s heavy-handed. MDN says it’s not recommended to grant no-store liberally, because you lose many HTTP and browser advantages, including the back/forward cache. Use it for sensitive pages only.

Sending nothing

As we saw, a missing header leaves browsers to guess. State your intent.

Mixing opposite instructions

Fastly found that 0.263% of responses combined max-age with no-cache or no-store. It’s a small share, but the instructions contradict each other, and caches may handle them in different ways.

Forgetting the CDN

Your browser rule and your CDN rule can differ. Check headers both with and without the CDN in the way.

How does SpeedyGo help with WordPress Cache-Control headers?

SpeedyGo handles caching rules for you, so you don’t have to edit server files.

Its features include browser caching, which lets returning visitors enjoy a faster browsing experience. Thebrowser caching guide explains how it works. For the page side, read aboutfull-page caching, and for smaller files, seeGzip andBrotli compression.

SpeedyGo - Caching & delivery

An honest note

The exact header values SpeedyGo sends can depend on your server and settings. After you switch on browser caching, check a few files in DevTools as shown above, and ask the team if anything looks off.

If you’d like a person to check your headers, Plus and Pro plans include technical fixes, and every paid plan includes human support hours. You can alsoopen a support ticket.

Make returning visitors fly through your site

What’s the Cache-Control checklist?

Run through these once. Your ticks stay on the page while it’s open.

  • Run a speed test. Note any “efficient cache policy” warnings.
  • Inspect headers in DevTools. Check one image, script, font and the page itself.
  • Give versioned files a long lifetime. One year is the usual choice.
  • Let HTML be checked each time. Use no-cache with validation, or a short lifetime.
  • Mark private pages as private. Never let a shared cache keep them.
  • Version files you change. New content, new file name or hash.
  • Test again after changes. Also with your CDN on and off.

The bottom line

Cache-Control headers are small, but they shape every repeat visit. Long lifetimes for files that never change. A quick check for pages. A firm “keep out” for private content.

You don’t need to memorize every directive. Remember the three jobs, check what your site sends, and let a good plugin apply the rules. That’s the practical way to get WordPress Cache-Control headers working for you.

Priya Patel

Priya Patel

With expertise in the technology and software industry, Priya specializes in in-depth research, understanding complex concepts, and translating them into well-structured, informative blogs that are easy for readers to follow.

Frequently Asked Questions

Here are answers to some common questions about Cache-Control directives, the difference between no-cache and no-store, recommended cache lifetimes, browser caching, and how to check whether your WordPress website is using the right settings.

What is a Cache-Control header?

It’s a line of text a server sends with a file. It tells browsers and other caches whether they may store the file, who may store it, and for how long it stays fresh.

What Cache-Control value is best for WordPress?

There’s no single value. Versioned static files such as CSS, JavaScript and fonts suit max-age=31536000. HTML pages usually suit no-cache so the browser checks for updates. Private or logged-in pages should use private or no-store.

Does no-cache mean the file isn't cached?

No. no-cache lets a cache store the file but requires it to check with the server before reusing it. Use no-store if a response must not be stored at all.

What's the difference between max-age and s-maxage?

max-age sets how long a response stays fresh in any cache, including the browser. s-maxage sets freshness for shared caches such as a CDN or proxy only, and overrides max-age there.

How do I check Cache-Control headers on my WordPress site?

Open your browser’s developer tools, go to the Network tab, reload, click a file and read the Response Headers. You can also run the SpeedyGo speed test and look for cache-related advice.

Can a long max-age cause problems?

Yes, if the file changes at the same address. Visitors may keep seeing the old version until it expires. Fix it by adding a version or hash to the file name so every update gets a new address.

Do I need a plugin to set Cache-Control headers?

You can set them in your server configuration, but a caching plugin is easier and safer for most owners. SpeedyGo’s browser caching feature is built for exactly this.