This is from the Microsoft support site. It gives an explanation of two
caching problems.  They reference IE 4 but you might try the suggestions
anyway.

<http://support.microsoft.com/support/kb/articles/Q222/0/64.ASP>
and
<http://support.microsoft.com/support/kb/articles/Q234/2/47.ASP>

This is the supposed mechanism to prevent caching in IE
<http://support.microsoft.com/support/kb/articles/Q234/0/67.ASP>

This is what we do, it seems to work fairly well:

  response.setHeader( "Pragma", "No-cache" );
  response.setDateHeader( "Expires", 0 );
  response.setHeader( "Cache-Control", "no-cache" );

We do this on every page. Another thing that we've tried to vary the query
string by putting some junk in the query string for a URL. This should look
like a new request to the client.

HttpQueryString.addStringArgument(url, "j=" + (int)(Math.random()*1000));

Finally, something someone else posted that we haven't tried:

>From: Sam Heisz [[EMAIL PROTECTED]]
>Subject: Perhaps you should use: Cache-control: private
>...
>response.addHeader("Cache-Control","private");
>
>See RFC 2068 Section 14.9 for information on the Cache-Control HTTP Header.
><URL:http://www.ietf.org/rfc/rfc2068.txt?number=2068>
>...

This solution is also suggested by the following Microsoft URL:
<http://support.microsoft.com/support/kb/articles/Q189/4/09.ASP>

I'm afraid that even all of this won't always solve your problem. We
recommend that users switch their internet settings on IE to "Check for
newer versions of stored pages: every visit to the page".

-----Original Message-----
From: Lisa Lewis [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 06, 2000 10:44 AM
To: [EMAIL PROTECTED]
Subject: IE5 caching of JSP pages, ( using JRUN )


I am having trouble preventing IE from caching my JSP pages.  I have
wasted an entire day on this.  I have read and tried every relevant post.
Below is a snippet of my code from one of my JSP pages that I would like the
browser NOT to cache!  I am adding the meta tags in both HTML and the JSP
response headers.  I tried various combinations of this.  I have also tried
to check the 'Set no-cache header on responses' checkbox in the JRUN
administration tool.  This doesn't seem to work either.  I have also tried
adding <meta http-equiv="Expires" content="0"> to the bottom of the JSP
page.
Someone had posted this suggestion as a way to get around a bug in IE5.  I
have not had any luck getting any of these solutions to work.

Note: When I set the response headers, the page doesn't show up in the
history
but it still caches the page because the next time I hit a button to bring
up
the new page, it retrieves the old one.  I am using Javascript:
parent.location=
"/servlet/GuiControllerServlet?actiontotake=displaypatientlistsplitframeset"
;
...when the button is clicked.

Any advice/suggestions will be greatly appreciated!

Thanks,
Lisa

code snippet:

<%
  // Try to prevent browsers from caching page!!
  response.setHeader("Pragma","no-cache"); // HTTP 1.0
  response.setDateHeader("Expires",0); //prevents caching at proxy server
  response.setHeader("Cache-Control", "no-cache");
  //response.setHeader("Cache-Control", "no-store"); // HTTP 1.1
%>

<html>
<head>

<meta http-equiv="Expires" content="0">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Cache-Control" content="no-store">

</head>

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
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

Reply via email to