Browser caching

Browser caching is based on the idea that it is not necessary to fetch all the files included in a response if some of these are exactly the same over a certain period of time. The way it works is through headers that are sent by the server to the browser in order to instruct it to avoid getting certain pages or files within a certain timeframe. Thus, the browser will display content kept within its cache rather than fetching the resources over the network within the span of that certain period of time, or until the resource changes.

Thus, browser caching relies on cache-control evaluation (expiration model) and response validation (validation model). Cache-control evaluation is defined as a set of directives that inform the ...

Get Mastering The Faster Web with PHP, MySQL, and JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.