James Stauffer wrote:
Would the java be the following? response.setHeader("Cache-control", "max-age=31536000");
James Stauffer
-----Original Message----- From: Spencer W. Thomas [mailto:[EMAIL PROTECTED] Sent: Friday, September 12, 2003 9:36 AM To: jdjlist Subject: [jdjlist] Re: Browser Caching JSPs
You need to set the Expires header in the HTTP response or a
Cache-control header with the max-age directive. The HTTP/1.1 spec,
ftp://ftp.isi.edu/in-notes/rfc2616.txt, describes these headers. Expires is section 14.21, the content of the header is a date in "RFC
1123" date format, e.g. Thu, 01 Dec 1994 16:00:00 GMT. If it is not in
exactly this format, the browser is supposed to ignore it. Section
14.21 goes on to say
To mark a response as "never expires," an origin server sends an Expires date approximately one year from the time the response is sent. HTTP/1.1 servers SHOULD NOT send Expires dates more than one year in the future.
The Cache-control/max-age directive is probably easier because you don't have to do any date computations. You just specify how long you want the cache to hold the page in seconds. Cache-control (section 14.9) header for this case looks like:
Cache-control: max-age=31536000
In straight Java: response.setHeader("Cache-control", "31536000");
=S
James Stauffer wrote:
> How can I allow the browser to cache URLs (using JSPs and servlets)? > i.e. View.jsp can be cached per parameter.
> /service/WebForms/View.jsp?docuID=25948 should never change.
>
> James Stauffer
>
> ---
> You are currently subscribed to jdjlist as: [EMAIL PROTECTED]
> To unsubscribe send a blank email to
> [EMAIL PROTECTED]
> http://www.sys-con.com/fusetalk
---
You are currently subscribed to jdjlist as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
http://www.sys-con.com/fusetalk
---
You are currently subscribed to jdjlist as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
http://www.sys-con.com/fusetalk
--- You are currently subscribed to jdjlist as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] http://www.sys-con.com/fusetalk
