Message-ID: <88281644.2723.1369314546132.JavaMail.email@example.com> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_2722_102479334.1369314546132" ------=_Part_2722_102479334.1369314546132 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
Section 14.29 of RFC2616|h= ttp://www.w3.org/Protocols/rfc2616/rfc2616.html] describes the last-modifie= d header. If this header is sent with a response containing content, then= the client is able to cache that content and check that it is up to date w= ith a request containing a If-Mod= ified-Since header.
If the content has not been modified, then a simple 304 response may be sent and the server can avoi= d resending the content.
Jetty will put a last-modified-header on all static content served and i= mplements support for the if-modified-since header in the default servlet t= hat serves that static content. For dynamic content generated by servlets, = last-modified and if-modified-since may be supported by implementing the getLastModified(request) method on the servlet= .
Even with a last-modified header, the client needs to issue a if-modifie= d-since request to verify that the contents of it's cache are up to date. = These extra requests can be avoided altogether by sending cache-control headers in the response that tell= the client how long the content can be held for, if it can be shared betwe= en users or if it can be cached at all.
Section 14.9 of RFC2616|htt=
p://www.w3.org/Protocols/rfc2616/rfc2616.html] describes the cache control =
header in detail. The Jetty default servlet allows the cache control header to be set for=
static content by using the cacheControl init parameter. For example,
if the init paramters for the default servlet included:
then static content would be cached for up to hour and shared between al= l users, without checking the server.
Back to Jetty Documentati= on