<\/span><\/h2>\nHTTP 1.1 extends the caching functionality from HTTP 1.0.<\/p>\n
In HTTP 1.1 a cached entry is considered fresh. At the point the expiry time is reached it is deemed stale. Should the cache entry be considered stale it must be revalidated with the origin server. However both client and origin are able to override this requirement.<\/p>\n
Due to the If-Modified-Since<\/strong> header using absolute timestamps (with a one-second-resolution) there was a potential for caching issues due to inconsistencies with time synchronization. To solve this issue a new cache validator string was introduced called an ETag<\/strong> (entity tag). Entity tags are provided with the cached response within the ETag header.<\/p>\nIn addition to If-Modified-Since<\/strong> HTTP 1.1 introduces the following conditional request-headers,<\/p>\n\n- If-None-Match : <entitiy tag><\/strong>– Instructs the server to send the resource if the entity DOES NOT exist of the server. If the entity does exist on the server a 304 (Not Modified) is returned. <\/li>\n
- If-Match : <entitiy tag> <\/strong>– Instructs the server to send the resource if the entity DOES exists on the server.<\/li>\n
- If-Unmodifed-Since : <date><\/strong> – Instructs the server to send the resource if the resource has NOT been modified since the date provided.<\/li>\n
- If-Range (entity_tag | date)<\/strong> – Used along with the Range header. This follows the same principle as above but is instead works a a byte range level rather then a resource level.<\/li>\n<\/ul>\n
2 further headers that were also added to HTTP 1.1 are the headers – cache-control and vary.<\/p>\n
\n- Cache-control<\/strong> was introduced within HTTP 1.1 and can be included in either the HTTP request or response. Further details of the various options can be found within the ‘Cache-Control Options’ section below.<\/li>\n
- Vary <\/strong>is sent within the servers response to the client and instructs any intermediary caches to cache a separate instance based on the headers specified within the vary header.<\/li>\n<\/ul>\n