Skip to content

Web Development & Performance

Caching: what it means and how it works

By Creolume Team4 min read

In short

Caching is the practice of storing a copy of data or a page so that it can be delivered quickly the next time it is needed, instead of being generated or fetched again from scratch.

What is caching?

Building a web page can involve database queries, templates and code. Doing this for every visitor wastes effort. Caching keeps the finished result, or part of it, and reuses it. The visitor gets a faster response, and the server does less work.

Caching happens at many levels, from the browser on a person's device to servers and networks around the world.

Types of caching

  • Browser cache: files stored on the visitor's device, such as images, CSS and scripts
  • Page cache: full HTML pages saved by the server or application
  • Object cache: database query results kept in memory, for example with Redis or Memcached
  • CDN cache: copies held on servers close to visitors
  • Opcode and application caches: compiled code and framework data
  • Edge and reverse-proxy caches: services such as Varnish or cloud edge platforms
Layers of caching: browser cache on the device, server page and object caches and CDN caches near the visitor
Each layer removes repeated work.

Benefits

Caching lowers time to first byte, reduces load on servers and databases and helps sites survive traffic peaks. It can improve Core Web Vitals and lower hosting costs. For many sites, correct caching is the single biggest speed improvement available.

Cache headers

Servers tell browsers and caches how long to keep a file using HTTP headers such as Cache-Control, Expires, ETag and Last-Modified. For example, versioned static files can be cached for a year, while HTML pages might be cached for minutes or revalidated on each visit. Good headers are a key part of performance.

Caching dynamic content

Pages that differ per visitor, such as carts, accounts and checkout, must not be cached in the same way, or one visitor could see another's data. Use rules to exclude private pages, cache fragments or use edge logic that separates shared and personal parts.

Cache invalidation

The hard part of caching is knowing when a stored copy is out of date. Common approaches are time-based expiry, clearing the cache when content changes, versioned file names and purging specific URLs through an API. Plan how updates reach visitors.

Common pitfalls

  • Caching private or personalised pages
  • Forgetting to clear caches after updates
  • Several caching layers with conflicting rules
  • Very short or missing cache headers on static files
  • Testing while logged in, which often bypasses caches
Checklist of caching checks: private pages excluded, clearing after updates, clear rules, long cache for assets, logged-out testing and TTFB measurement
Six checks for safe, effective caching.

Tools and testing

Browser developer tools show cache status and headers. WordPress sites often use caching plugins and server-level caching. Test as a logged-out visitor, check headers, and measure time to first byte before and after changes.

Caching for WordPress and e-commerce

WordPress sites usually combine a page cache, an object cache and browser caching, often through a plugin or the host's own tools. For WooCommerce, exclude the cart, checkout and account pages, and make sure cart fragments do not cause every page to bypass the cache.

Check your host's built-in caching first, because adding several overlapping plugins can cause conflicts. Test the checkout, logged-in views and forms after any change, and clear caches whenever you update prices, stock or design.

Key takeaways

  • Caching stores copies so content is delivered faster
  • Layers include browser, page, object and CDN caches
  • Cache headers control how long copies are kept
  • Do not cache personal pages, and plan invalidation
  • Test as a logged-out visitor and measure TTFB

How Creolume can help with Caching

We find what slows your pages and fix it, then prove the improvement with before and after data. If Caching is on your list of priorities, our team can review where you stand, explain what matters for your site and your market, and agree a realistic plan.

You can explore our Website Speed Optimization service or contact us for a short, no-obligation conversation. We will tell you honestly what is worth doing first and what can wait.

Caching FAQs

What is caching?

Storing a copy of data or a page so that it can be served faster next time.

What is browser cache?

Files stored on a visitor's device so that repeat visits load faster.

Why does my website not update after a change?

An old cached copy may still be served. Clear the relevant caches or purge the URL.

Is caching safe for e-commerce?

Yes, if carts, accounts and checkout are excluded or handled so that personal data is never shared.

What is a cache-control header?

An HTTP header that tells browsers and caches how long they may store a response.

Should I clear the cache after every update?

Yes, for changed pages or assets. Many systems purge automatically, but check after design changes and deployments.

What is a cache hit ratio?

The percentage of requests served from cache. A higher ratio means less work for your origin server.

Not sure where to start?

Tell us about your site and your goals. We will reply with an honest view of what to fix first.