[Next] [Up] [Previous]
Next: References and Further Information Up: Caching Previous: Cache-Control HTTP Headers

Validation and Validators

In the previous paragraphs, we claimed that validation is used by servers and caches to communicate when an object has been changed. By using it, caches avoid having to download the entire object when they already have a copy locally, but they are not sure if it's still fresh. Validators are very important; if one isn't present, and there isn't any freshness information (Expires or Cache-Control) available, most caches will not store an object at all. The most common validator is the time that the document last changes, the Last-Modified time. When a cache has an object stored that includes a Last-Modified header, it can use it to ask the server if the object has changed since the last time it was seen, with an If-Modified-Since request (Conditional GET). HTTP/1.1 introduces a new kind of validator called the ETag. ETags are unique identifiers that are generated by the server and changed every time the object does. Because the server controls how the ETag is generated, caches can be sure that if the ETag matches when they make a If-None-Match request, the object really is the same. Almost all caches use the Last-Modified times in determining if an object is fresh; as more HTTP/1.1 caches come online, ETag headers are also used. Most modern web servers (e.g. Apache) generate both ETag and Last-Modified validators for static content automatically; the maintainer of a site need not do anything. However, servers don't know enough about dynamic content (like CGI, ASP, JSP or database sites) to generated them.
[Next] [Up] [Previous]
Next: References and Further Information Up: Caching Previous: Cache-Control HTTP Headers
Copyright © 2003, John Yannakopoulos <giannak@csd.uoc.gr>