Skip to main content

Mini Project: Caching and Smaller Responses

Learn Mini Project: Caching and Smaller Responses (Performance Optimization, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Mini Real-Time Project: Caching and Smaller Responses Problem A busy page is slow because every visit downloads the full data again. Use HTTP caching (ETag, Last-Modified, Cache-Control) so repeat visits cost nothing, and let clients ask for only the fields they need. Requirements Add a ShallowEtagHeaderFilter and show 200 first, then 304 Not Modified. Use checkNotModified with Last-Modified for a resource with a known change time. Send Cache-Control headers for static-like data. Reduce the payload with a fields parameter and compare sizes. Concepts Used ETag / If-None-Match Last-Modified /...

More lessons in Performance Optimization