← All posts

Why Your Code Isn’t Updating: A Quick Guide to Caching

Learn what caching is and why your recent changes might still look old.

🚀 The Simple Version

1. What’s a Cache?

A cache is like a side drawer that stores quick copies of stuff you’ve already seen, so the next time you need it, you can grab it fast instead of fetching it from the original source.

2. Where Does It Live?

  • Browser cache – your web browser keeps images, scripts, and pages to speed up loading.
  • Server cache – the website’s server can store ready‑made pages to serve them faster.
  • CDN cache – a network of servers around the world that keep copies of your site for quick delivery.

3. Why Your Changes Aren’t Showing

When you update code, the old copy in a cache can still be handed out. It’s like ordering a new dish at a restaurant, but the waiter keeps serving the previous version because the kitchen still has the old recipe in the drawer.

4. How to Force an Update

  • Clear the browser cache: press Ctrl+Shift+Delete (Windows) or Cmd+Shift+Delete (Mac).
  • Hard reload the page: Ctrl+F5 (Windows) or Cmd+Shift+R (Mac).
  • Rename or version static files (e.g., style.css?v=2) so the cache sees it as new.
  • In development, disable caching in your local server settings.

5. Quick Fix Checklist

  • Did you clear the right cache? (browser, server, CDN?)
  • Did you update the file name or add a query string?
  • Are you looking at the right environment (dev vs prod)?