Performance

Browser caching

Telling visitors' browsers to keep copies of files like images and stylesheets so repeat visits load faster.

By Nick Irmo · Updated

What Browser caching means

When files are cached in the browser, returning visitors do not download them again. It is set with server headers and costs nothing to run. It mainly speeds up second and later page views.

Why it matters for your website

When browsers store your logo, fonts and stylesheets, returning visitors do not have to download them again, so pages appear faster. That improves the experience for repeat customers and lowers the load on your server. It is usually a small configuration change with a clear payoff.

Example

A coffee shop's site sets long cache times for its fonts and images. Customers who check the menu every week see pages load almost instantly after the first visit.

Tips

  • Set long cache lifetimes for files that rarely change, like fonts and logos.
  • Use versioned file names so updated files are fetched right away.
  • Check caching headers with a page speed tool after setup.

Common mistakes

  • Caching HTML pages too long, so visitors keep seeing outdated content.
  • Changing a stylesheet without changing its name, leaving visitors with the old styles.

Questions about Browser caching

What is Browser caching?
Telling visitors' browsers to keep copies of files like images and stylesheets so repeat visits load faster.
How do I enable browser caching?
It is set through HTTP headers like Cache-Control on your server, host or CDN. Many hosts, CDNs and caching plugins set sensible defaults for you.
Why do visitors still see the old version of my site?
Their browser may be using cached files. Using versioned file names or clearing your CDN cache usually solves it, and visitors can also do a hard refresh.

Tell us what the site needs to do.

Share a few details and a budget range. We reply within one business day with a plan, a platform recommendation and a fixed quote.