Prentice Hall and Sun Microsystems. Personal use only; do not redistribute.
102
Chapter 4 Handling the Client Request: HTTP Request Headers
If Match
This rarely used header applies primarily to
PUT
requests. The client
can supply a list of entity tags as returned by the
ETag
response header,
and the operation is performed only if one of them matches.
If Modified Since
This header indicates that the client wants the page only if it has been
changed after the specified date. This option is very useful because it
lets browsers cache documents and reload them over the network only
when they've changed. However, servlets don't need to deal directly
with this header. Instead, they should just implement the
getLastMod
ified
method to have the system handle modification dates automati
cally. An illustration is given in Section 2.8 (An Example Using Servlet
Initialization and Page Modification Dates).
If None Match
This header is like
If Match
, except that the operation should be per
formed only if no entity tags match.
If Range
This rarely used header lets a client that has a partial copy of a docu
ment ask for either the parts it is missing (if unchanged) or an entire
new document (if it has changed since a specified date).
If Unmodified Since
This header is like
If Modified Since
in reverse, indicating that the
operation should succeed only if the document is older than the speci
fied date. Typically,
If Modified Since
is used for
GET
requests ( give
me the document only if it is newer than my cached version ), whereas
If Unmodified Since
is used for
PUT
requests ( update this docu
ment only if nobody else has changed it since I generated it ).
Pragma
A
Pragma
header with a value of
no cache
indicates that a servlet that
is acting as a proxy should forward the request even if it has a local copy.
The only standard value for this header is
no cache
.
Second edition of this book: www.coreservlets.com; Sequel: www.moreservlets.com.
Servlet and JSP training courses by book's author: courses.coreservlets.com.
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved