Thanks Kare.
I've taken a look at the HTTP/1.1 RFC. I have a couple of questions about
the following code,
> > > response.addHeader("Pragma", "No-cache");
> > > response.addHeader("Cache-control", "no-cache");
> > > response.addDateHeader("Expires", 1);
Fistly, I recognize that this code will prevent a cache and I recognize that
this is a published way of preventing caching from within JSP's (see
O'Reilly's "Java Server Page" page 264 for instance). But after reading the
RFC, I have two questions about this code:
1. Wouldn't the use of response.addDateHeader() alone be enough to control
caching (and non-caching)? That is, if response.addDateHeader() is used,
wouldn't the calls to response.addHeader() be unnecessary?
2. I'm wondering why a figure of 1 is used in
response.addDateHeader("Expires",1)? I thought a value of 0 or less would be
more appropriate, like, addDateHeader("Expires",0)?
My questions are given not to challenge the validity or refute the original
poster's response, but to enhance my understanding of how the headers are
used to control caching. Does anyone have any feedback on this?
Thanks
Rob
----- Original Message -----
From: "Kare Nuorteva" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 21, 2001 5:07 AM
Subject: Re: Caching a JSP Page
> On Wed, 21 Mar 2001, Rob L'Estrange wrote:
>
> > Does anyone know where all possible response headers are documented?
>
> I think HTTP RFC documents might be useful.
>
> http://www.rfc-editor.org/
>
> Cheers,
> Kare
>
> > ----- Original Message -----
> > From: "Hoorn, Michiel van" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Wednesday, March 21, 2001 1:19 AM
> > Subject: Re: Caching a JSP Page
> >
> >
> > > Or this in yuor jsp:
> > >
> > > <%
> > > response.addHeader("Pragma", "No-cache");
> > > response.addHeader("Cache-control", "no-cache");
> > > response.addDateHeader("Expires", 1);
> > > %>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets