----------------------------------------------------------------
BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
WHEN YOU POST, include all relevant version numbers, log files,
and configuration files. Don't make us guess your problem!!!
----------------------------------------------------------------
We've run into the same behavior but it occurs on two levels -- browser
caching and proxy server caching. Our application performed correctly on
our system where there is no caching turned on, but when it went live it was
getting hit by some groups of users with proxy and browser caching set on.
By embedding <META> tags in our HTML and using the
HttpResponseServlet.setHeader() method in our servlet/jsp code, we were able
to tell the browser and proxy not to use caching. As far as I know, most
browsers and proxies will obey these messages -- but it's not gauranteed.
For a few users, we had no choice but to ask them to turn proxy caching off.
Here are the META tags we included in the <HEAD></HEAD> of our HTML output:
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
And we followed that up with the following headers in the response:
response.setHeader("CacheControl", "no-cache");
response.setHeader("Pragma", "no-cache");
response.setHeader("Expires", "-1");
I think the META tags just add stuff to the html header anyway but there was
complete chaos when this problem came up and we thought over doing it
wouldn't hurt.
Kevin
-----Original Message-----
From: Ola Samuelson <[EMAIL PROTECTED]>
To: Java Apache Users <[EMAIL PROTECTED]>
Date: Friday, April 07, 2000 11:05 AM
Subject: Cached servlet output
>----------------------------------------------------------------
>BEFORE YOU POST, search the faq at <http://java.apache.org/faq/>
>WHEN YOU POST, include all relevant version numbers, log files,
>and configuration files. Don't make us guess your problem!!!
>----------------------------------------------------------------
>
>Hi!
>This could be an Apache issue, but since it appeared while I was
>modifying my servlet code ...
>Maybe it's me being a complete idiot, but ..
>
>Got:
>Apache 1.3.12
>Jserv 1.1
>JSSI1.1.2
>JDK 1.2.2.RC4
>
>Works - great. There is, however, one problem.
>My servlet output seems to be cached, not refreshed or whatever.
>
>This happens.
>1. Servlet call "show xyz"
>2. Output from database via servlet: "xyz"
>3. Servlet call "show abc"
>4. Output from database via servlet is still: "xyz" UNTIL I the reload
>the frame.
>
>I have another machine with exact same configfiles(yes I have "cloned"
>the disks) where this does not happen.
>The difference is that I have added som servlets and code. But I can't
>find
>what may cause this. Cache is OFF in apache. Oh yes, one difference
>more, The working one is compiled with SSL
>and the other one is not. But they both have SSL directives in the
>httpd.conf and none is started with SSL.
>
>To the questions:
>1. Known issue? If so with what? What am I doing wrong?
>2. Can I make sure that the document is not cached by writing some
>header to the respons? (tried "pragma no cache" without any effect.)
>
>Other suggestions?
>
>I realise that it may well be my code(oh no...) but it could also be
>something that is known.
>If needed, I'll post some code.
>Thanks!
>//OLAS
>
>
>
>
>
>--
>--------------------------------------------------------------
>Please read the FAQ! <http://java.apache.org/faq/>
>To subscribe: [EMAIL PROTECTED]
>To unsubscribe: [EMAIL PROTECTED]
>Archives and Other: <http://java.apache.org/main/mail.html>
>Problems?: [EMAIL PROTECTED]
>
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://java.apache.org/main/mail.html>
Problems?: [EMAIL PROTECTED]