From the course: Complete Guide to Spring MVC

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

CacheControl

CacheControl

- [Instructor] CacheControl. To create a solid foundation for this section, we'll go over what is caching first. Caching is a strategy used to store frequently accessed data in a high speed storage layer. So think like your RAM to minimize redundant computation or data retrieval. The two key aspects of caching are data access and storage. Let's talk about the data access part. You have reads and you have writes. The read operation checks the cache first. If the data exists, this is called a cache hit, and it's retrieved quickly. Otherwise, it's a cache miss, and it's fetched from the source and stored in the cache. Next, you have the write operation. This ensures the cache remains consistent with the source by updating or invalidating outdated cache entries. You remember what that second part of caching was? It was storage. Caching typically uses fast memory or dedicated tools like memcached or browser storage to reduce latency and bandwidth. So when looking at HTTP caching, HTTP…

Contents