First off, I have a similar servlet sending images running in Orion right
now and it does not display this behavior  (Although mine uses path info
instead of request parameters so the URL still looks like an image).  So I'm
pretty sure its not Orion.

Narrowing to a solution depends alot on whether the problem exists on the
client or on the server.

You should start out by forcing response headers to instruct the browser to
not cache the results.  This really can't do much harm so, its good to do
even if the problem is on the server.  Use these (assuming 'res' is an
instance of HttpServletResponse)

  res.setHeader("Cache-Control", "no-cache");
  res.setHeader("pragma", "no-cache");
  res.setHeader("expires", System.currentTimeMillis());

If this doesn't fix the problem, I'd start looking at the servlet itself.
I'd make absolutely sure that you have the appropriate things in the request
scope verses the class scope.  Its easy to miss something in the wrong scope
and accidentally create this kind of behavior. 

-----Original Message-----
From: Todd McGrath [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 30, 2001 11:25 AM
To: Orion-Interest
Subject: image/servlet caching issue


I'm having what I believe to be a image/servlet issue cache issue with Orion
1.4.5:

Situation:
I'm creating dynamically generated graphs based on an authenticated user.
The images are created by passing values to a graph generating servlet.

HTML looks like this:

<img border="0"
src="/Incentive1Graph?mgmt01=37500&min=10009&target=25024&gold=37535">

where Incentive1Graph is a servlet that produces the image based on mgmt01,
min, target and gold values.

The very first time the servlet is run it produces the correct image.
However, on any subsequent calls with a different user, the original image
is returned.  I think the image/servlet is being cached by Orion and thus,
always returns the first image that was created.  If I restart Orion, log in
with a different user, the image produced is correct.

Here's what I've done to debug so far:

1) Verfied the values for mgmt01, min, etc. are changing with different
users
2) Deleted all files in the persistence directory
3) Deleted my browser cache
4) Tried with both Netscape and IE
5) Verified that I'm not accessing the test site through a proxy
6) Searched the Orion mailing list for similar issues

Any other ideas???

My questions are:
1) how do disable image/servlet caching in Orion config?
2) is there something I can write in the Incentive1Graph servlet that will
prevent it from being cached?


Thanks in advance,
Todd


Reply via email to