This should work, from within a servlet, to set the headers for no cache.
resp = self.response()
resp.setHeader('Expires', 'Mon, 26 Jul 1997 05:00:00 GMT')
resp.setHeader('Cache-Control', 'no-cache, must-revalidate')
[mailto:webware-discuss-admin@... Behalf Of Ian
Sent: Tuesday, February 12, 2002 8:44 PM
To: Matt Feifarek
Subject: Re: [Webware-discuss] Caching
On Tue, 2002-02-12 at 19:27, Matt Feifarek wrote:
> I have two questions related to caching.
> 1. How can I get a servlet to NOT cache itself? The behavior I want is to
> have the servlet re-execute, to gather possibly new state information.
> I'm making a graph from a log file, and it should update (re-execute) if
> log has changed. If you hit the servlet a second time, it just shows the
Servlets don't cache their output, which is (I think) what you are
talking about. It's problematic to keep browsers from caching their
images: if you create a new image, you should use a new URL (even if it
isn't in a meaningful way, e.g., adding a meaningless get variable onto
it). Other caching you notice is probably on the browser end. If you
are using Mozilla, I think you have to hit shift to really get it to
reload (it's a little stuborn).
> 2. What is the most correct way to tell the /browser/ not to cache a given
> URL? I know of a couple of ways, left over from my old .asp days, but I
> wondered what the best webware way is.
Oh, I always forget the exact format and headers, but it's all the
standard ways, mostly setting a header about expiring. There's no
Webware specific techniques.
Webware-discuss mailing list