----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, December 06, 1999 10:00 AM
Subject: Re: Request for HTTP documentation, tutorials, and/or workshops


> David Chisolm writes:
>
> > I was having a very strange caching problem - different from the kind
> > normally posted here, and I needed to really understand how caching
> > directives are supposed to work.
> > [ ... ]
> > error.  Of course, everything worked just fine in IE.  (For the version
> > conscious, I tested this with NS 4.08, 4.5, 4.6 & 4.7, and IE 4.0 & 5.0)
>
>      Hm, are you sure?  I've seen some really odd behavior with IE5
> not obeying caching directives.  Particularly annoying is that both NS
> and IE seem to always cache POST arguments no matter whether the pages
> before and/or after the POST are no-cached.
>
> > Anyway, the only headers that I set now are:
> >
> >   response.setHeader("Pragma", "No-cache");
> >   response.setHeader("Cache-Control","no-cache" );
> >   response.setHeader("Cache-Control","no-store" );
> >
> > This fixed the problem, and my pages do not go into the cache.
>
>      Hm, I didn't have the no-store header, and from what you said,
> the expires header actually caused a problem?

Well, at least given the way that I was specifying the date value, it was
causing a problem.  I was told later that Netscape is very picky about date
values and would only work with the standard date format (though the spec
says clients should respect zero ('0')).


Here's the message that I got about Netscape and Dates:
----------------------------------------------------------------------------
----------------------------

You say everything works OK in Netscape if you leave out the
setDateHeader() call. This reminds me of a similar problem I had with
Netscape. It's pretty picky with the date format (it actually expects it
to follow the relevant standard), so toString() of the Date class (which
I suspect your code indirectly uses) won't do. Try to set up a
SimpleDateFormat - it's quite easy. This piece of code works for me:

    DateFormat df = new SimpleDateFormat("EEE, dd MMM yy HH:mm:ss z");
    df.setTimeZone(TimeZone.getTimeZone("GMT"));

    Date now = new Date();
    String nowPlus= df.format(now);
    // Unfortunately SimpleDateFormat throws in a TimeZone
    // of "GMT+00:00", and we only need "GMT". We therefore
    // must get rid of "+00:00" like this:
    String nowOK = new StringTokenizer(nowPlus, "+").nextToken();

You may of course format all Dates this way.

------------------------------------------------------------------------
Morten Norby Larsen                              [EMAIL PROTECTED]
Magister Ludi Multimedia Lab                   Phone: +39 02 26 11 72 80
Via Battaglia 8, I-20127 Milano, Italy         Fax:   +39 02 26 11 67 33
                       http://www.magisterludi.com

----------------------------------------------------------------------------
----------------------------






> I'll have to try it
> this way.
>
> Steven J. Owens
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to