From the course: Complete Guide to Spring MVC

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Shallow ETag

Shallow ETag

- [Instructor] Shallow ETag. In order to understand Shallow ETags, let's make sure we understand what regular ETags are. ETags or Entity Tags are HTTP headers used for caching. Shallow ETags are calculated based solely on the response content, not the underlying data. This can be useful for improving performance by avoiding unnecessary redownloads when the resource hasn't changed. Let's compare ETags and Shallow ETags. ETags will provide more granular control over caching and are better suited for applications where underlying data changes frequently. However, they require a more complex implementation. Shallow ETags offer a simple approach for basic caching based on response content. They are suitable for applications where, like, response changes are relatively infrequent. The ShallowEtagHeaderFilter in Spring MVC automatically generates Shallow ETags for responses and handles conditional requests based on these ETags. The way that it works is, one, you intercept the response. The…

Contents