---
title: "What is caching and what should I cache in a web application?"  
description: "What is caching and what should I cache in a web application?"  
author: "Arnaud Simon"  
published: 2026-11-14  
updated: 2026-11-14  
canonical: https://www.mindstick.com/forum/163027/what-is-caching-and-what-should-i-cache-in-a-web-application  
category: "Web and API Design"  
tags: ["caching", "Web Performance", "Redis", "HTTP cache", "scalability"]  
reading_time: 1 minute  

---

# What is caching and what should I cache in a web application?

People say "just add caching" to fix slow pages. What does it really mean, and what is safe to cache?

## Replies

### Reply by Madison Ross

Caching means storing the result of something slow so that the next request can reuse it. It can happen at several levels:

- **Browser cache**: static files such as images, CSS and JS, controlled with Cache-Control headers.
- **CDN**: copies of files near the user.
- **Application cache**: in-memory (IMemoryCache) or distributed (Redis) data, such as a list of countries or a rendered fragment.
- **Database or query cache**: results of heavy reports.

Good candidates: data that is read often and changes rarely. Poor candidates: per-user private data (unless the key includes the user), or anything that must always be exact, such as a bank balance.

The hard part is invalidation: deciding when cached data is out of date. Use sensible expiry times, remove entries when the data changes, and add a size limit. Always make sure the page still works if the cache is empty.


---

Original Source: https://www.mindstick.com/forum/163027/what-is-caching-and-what-should-i-cache-in-a-web-application

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
