HTTP caching
When the client requests the same resource representation many times, it will be a waste of time to provide it from the server side and it will be time-consuming in web applications. Instead of talking to the server, if the the resource is reused it will definitely improve the web application performance.
Caching will be considered a primary option for bringing performance to our web application. Web caches avoid server contact multiple times and reduce the latency; hence, the application will be faster. Caching can be applied on different layers of an application. In this chapter, we will only talk about HTTP caching, which is considered a middle layer. We will dig more into other forms of caching in Chapter 11, Scaling.
HTTP cache control
Cache control is a header field that specifies directives for caching operations on the web. These directives give the caching authorization, define the duration of the caching, and so on. The directives define the behavior, usually intended...