The TCP/IP Guide - Version 3.0 (Contents) ` 1566 _ © 2001-2005 Charles M. Kozierok. All Rights Reserved.
Despite not being specific to either requests or replies, some general headers are used
either mostly or entirely in one or the other type of message. There are also some general
headers that can appear in either a request or a reply, but have a somewhat different
meaning in each.
Cache-Control
Specifies directives that manage how caching is performed either for an HTTP request or
response. These directives affect the handling of a request or response by all devices in the
request/response chain from the HTTP client, through any present intermediaries, to the
HTTP server (or the other way, from the server, through intermediaries, to the client). They
override any default caching behavior performed by a device. See the topic on caching for a
full exposition of the subject.
There are a dozen individual directives that can appear in this header, the full details of
which can be found in RFC 2616. Even though this is a general header, some directives
can appear only in a request or a response. Some also include an additional parameter,
such as a number of seconds, that control their interpretation. Table 277 provides a brief
summary of the different Cache-Control options and how they are used.
Note that only one directive may appear in a Cache-Control header, but more than one
such header can appear in a message.
Table 277: HTTP Cache-Control Directives (Page 1 of 2)
Cache-
Control
Directive
HTTP
Message
Type
Description
no-cache
Request or
Response
When present, forces a caching device to forward any subsequent requests
for the same content to the server for revalidation. That is, the cache must
check with the server to ensure that the cached data is still valid.
Also see the Pragma header description, for an alternative way of accom-
plishing the same thing.
public Response
Indicates that the response may be cached by any cache, including a shared
one (a cache used by many clients). See the topic on caching for more details
on shared caches.
private Response
Specifies that the response is intended for only a particular user and should
not be placed into a shared cache.
no-store
Request or
Response
Specifies that the entire request or response should not be stored in a cache.
This is used sometimes to prevent the storing of sensitive documents in
caches where unauthorized people might be able to access them. However,
as the HTTP standard points out, this is really a very rudimentary security
measure and should not be trusted a great deal (since a malicious cache
operator could simply ignore the directive.)
max-age
Request or
Response
In a request, indicates that the client is willing to accept a response whose age
is no greater than the value specified. In a response, indicates the maximum
age of the response before it is considered “stale”—this is an alternative to the
use of the Expires header and takes precedence over it.