The browser cache is a store of website files, such as images, stylesheets, scripts and fonts, that a visitor’s browser keeps on their own phone or computer after the first visit. Next time a page needs the same file, the browser uses its saved copy instead of downloading it again, so the page appears faster.
How the browser cache works
Your server decides what may be kept and for how long by sending instructions with every file, in what are called HTTP headers. The main one is Cache-Control. A value such as max-age=31536000 tells the browser it can reuse the file for a year without asking; no-cache tells it to check with the server first. When a browser checks, the server can reply “not modified” in a few bytes instead of resending the whole file.
A sensible set-up treats files differently. Logos, fonts, stylesheets and scripts change rarely, so they get long lifetimes. The HTML of each page changes whenever you edit it, so it is usually kept briefly or checked every time.
Long lifetimes raise an obvious question: what happens when you do change the stylesheet? The answer is versioning. Well-built sites give each version of a file a different name, for example style.css?ver=4.2 or a file name with a code in it. When the file changes, the name changes, and every browser fetches the new one straight away. WordPress, Shopify and most modern build tools do this automatically for their own files.
The browser cache is only one layer. Your server may also keep ready-made pages, and a CDN may hold copies nearer the visitor. The wider caching entry explains how the layers fit together.
Why it matters
Most visitors see more than one page, and many come back. With good cache rules, the second page of a visit downloads only what is new, which feels noticeably quicker on a patchy mobile connection on a train. It also reduces the data your host sends, which can matter on plans with a bandwidth limit.
Google’s PageSpeed Insights reports static files with short cache lifetimes, so weak cache rules are an easy, measurable improvement. The cache also explains a common frustration: you update the website, but you or your client still see the old version. That is usually your own browser showing its saved copy.
Common mistakes
- Sending no cache headers at all, so every page view downloads the same logo and fonts again.
- Setting long lifetimes without versioned file names, which leaves visitors stuck with an old stylesheet for weeks.
- Allowing pages with personal content, such as a basket or account page, to be stored and reused.
- Telling customers to “clear their cache” rather than fixing the versioning that caused the problem.
- Confusing clearing the cache with clearing cookies, which also logs you out of sites.
How to act on it
When you cannot see a change you have just made, do a hard refresh first: Ctrl+Shift+R on Windows or Cmd+Shift+R on a Mac. If that shows the new version, the site is fine and only your browser was out of date.
To check your cache rules, open the developer tools in Chrome, go to the Network tab, reload the page and click on an image or stylesheet. The response headers show its Cache-Control value. Static files should normally have long lifetimes; pages with personal information should not be stored.
Rules are set in your hosting configuration, a caching plugin or your CDN, depending on the platform. If PageSpeed Insights keeps flagging cache lifetimes, or edits are slow to appear for visitors, it is worth fixing properly. Cache headers are one of the checks in my technical SEO audits.
