There are three mechanisms to control a cache defined in HTTP standard, which are as follows:
Freshness: This mechanism will allow the user to use a response without rechecking it on the original server. It can be controlled by both the server and the client. For example, the
Expires
response header will give a date when the document becomes stale, andCache-Control
(the max-age directive) will inform the cache how many seconds the response is fresh (valid) for.Validation: This mechanism may be used for checking whether a cached response is still good after it becomes stale. For example, if a
Last-Modified
header is in response, a cache can make a next request using theIf-Modified-Since
header and check if it has changed. TheETag
(entity tag) mechanism also allows for both strong and weak validation.Invalidation: This mechanism mostly is a side effect when another request passes through the cache. So, if a URL related with a cached response later on gets a
POST
,PUT
, or...