Professional Documents
Culture Documents
.2 Response Headers: 5. Caching For More Information
.2 Response Headers: 5. Caching For More Information
2 Response Headers
HTTP servers use headers in the response message
to specify how content is being returned and how it
should be handled. If you are using IE, you will have
seen the following headers returned with the image in
Example 2:
Cache-Control: no-cache
Content-Type: image/gif
Expires: -1
The Expires header specifies when the content
should be considered to be out of date. The value -1
indicates that the content expires immediately and
would have to be re-requested before being
displayed again.
Pragma: no-cache
X-AspNet-Version: 2.0.50727
Responses
Field name Description Example
Content-
The mime type of this content Content-Type: text/html; char
Type
created.
Server: Apache/1.3.27 (Unix)
Server A name for the server Hat/Linux)
Example session
Below is a sample conversation between an HTTP
client and an HTTP server running
on www.example.com, port 80.
[edit]Client request
GET /index.html HTTP/1.1
Host: www.example.com
5. HTTP Caching
Web pages often contain content that remains
unchanged for long periods of time. For example, an
image containing a company logo may be used
without modification for many years. It is wasteful in
terms of bandwidth and round trips to repeatedly
download images or other content that is not
regularly updated.
private The content is intended for use by a single user and should only be cached
locally in the browser.
public The content may be cached in public caches (e.g. shared proxies) and private
browser caches.
Example 5
The images in this example demonstrate different levels
of caching. It is worth trying the following actions in
Internet Explorer to investigate how well these images are
cached: