Hi,
You could write a servlet filter and only map it to those resources in
web.xml
Ryan
-Original Message-
From: Keith Bottner [mailto:[EMAIL PROTECTED]
Sent: 30 July 2004 13:53
To: [EMAIL PROTECTED]
Subject: How do you set cache-control for static (gif, jpg) resources
I am trying to f
Hi,
Tomcat doesn't set any caching headers by itself. To do so, you can
write a simple filter (examples of this filter are freely available on
the net, it's about 10 LOC) that looks at the response content-type and
adds headers as needed.
Yoav Shapira
Millennium Research Informatics
>-Orig
Ok, I wrote a simple filter. No problem. It works!
One question. Is there a standard way to determine if your filter is being
called during the request chain or during the response chain?
If I use
response.putHeader(headerName, fc.getInitParameter(headerName));
It will add the header once durin
s List'
>Subject: RE: How do you set cache-control for static (gif, jpg)
resources
>
>Ok, I wrote a simple filter. No problem. It works!
>
>One question. Is there a standard way to determine if your filter is
being
>called during the request chain or during the respo
);
}
Then I get two additions in the response stream.
Any more ideas?
Keith
-Original Message-
From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
Sent: Friday, July 30, 2004 8:20 AM
To: Tomcat Users List
Subject: RE: How do you set cache-control for static (gif, jpg) resources
Hi,
You have to call
Hi,
>Previously I was calling doChain at the end of my doFilter method.
>
>Making the change you suggest, calling doChain at the top like
>DOES NOT INSERT any of my changes into the response stream. If I do it
like
>this:
>Then I get two additions in the response stream.
>
>Any more ideas?
Tha
AM
To: 'Tomcat Users List'
Subject: RE: How do you set cache-control for static (gif, jpg)
resources
Ok, I wrote a simple filter. No problem. It works!
One question. Is there a standard way to determine if your filter is
being
called during the request chain or during the response chai
mailto:[EMAIL PROTECTED]
Sent: Friday, July 30, 2004 8:40 AM
To: Tomcat Users List
Subject: RE: How do you set cache-control for static (gif, jpg) resources
Hi,
>Previously I was calling doChain at the end of my doFilter method.
>
>Making the change you suggest, calling doChain at the top l
--Original Message-
>From: Keith Bottner [mailto:[EMAIL PROTECTED]
>Sent: Friday, July 30, 2004 9:59 AM
>To: 'Tomcat Users List'
>Subject: RE: How do you set cache-control for static (gif, jpg)
resources
>
>
>
>Unfortunately HttpServletResponse has now way to query
m that second server?
Yoav Shapira
Millennium Research Informatics
>-Original Message-
>From: Keith Bottner [mailto:[EMAIL PROTECTED]
>Sent: Friday, July 30, 2004 9:59 AM
>To: 'Tomcat Users List'
>Subject: RE: How do you set cache-control for static (gif, jpg)
resources
&
D]
>Sent: Friday, July 30, 2004 10:45 AM
>To: 'Tomcat Users List'
>Subject: RE: How do you set cache-control for static (gif, jpg)
resources
>
>RequestDumperValve dump's the request and the response.
>
>So the request is first and the response follows the do
er cleanup
operations.
Thanks for all you help, I appreciate your time.
Keith
-Original Message-
From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
Sent: Friday, July 30, 2004 9:55 AM
To: Tomcat Users List
Subject: RE: How do you set cache-control for static (gif, jpg) resources
Hi,
Yeah,
t;
>
>
>Hi,
>Yeah, I saw his response, but you didn't mention IllegalStateExceptions
in
>your log so I assumed the response being committed wasn't the problem
>;) Weird.
>
>Yoav Shapira
>Millennium Research Informatics
>
>
>>-Original Message-
, 2004 10:14 AM
To: Tomcat Users List
Subject: RE: How do you set cache-control for static (gif, jpg) resources
Hi,
No problem about the help ;) Sadly enough, I know most of the Servlet Spec
by heart now. But more importantly, I have filters that do stuff on the
request side, check the response
iginal Message-
From: Keith Bottner [mailto:[EMAIL PROTECTED]
Sent: Friday, July 30, 2004 10:45 AM
To: 'Tomcat Users List'
Subject: RE: How do you set cache-control for static (gif, jpg)
resources
RequestDumperValve dump's the request and the response.
So the request is first and the re
but, the
solution I settled on seems to work.
Keith
-Original Message-
From: Dennis Dai [mailto:[EMAIL PROTECTED]
Sent: Friday, July 30, 2004 3:07 PM
To: Tomcat Users List
Subject: Re: How do you set cache-control for static (gif, jpg) resources
I've been reading this thread bac
the
solution I settled on seems to work.
Keith
-Original Message-
From: Dennis Dai [mailto:[EMAIL PROTECTED]
Sent: Friday, July 30, 2004 3:07 PM
To: Tomcat Users List
Subject: Re: How do you set cache-control for static (gif, jpg) resources
I've been reading this thread back and forth
when
they are not set they work much better.
Keith
-Original Message-
From: Dennis Dai [mailto:[EMAIL PROTECTED]
Sent: Friday, July 30, 2004 7:18 PM
To: Tomcat Users List
Subject: Re: How do you set cache-control for static (gif, jpg) resources
Keith,
This is on one of my development
18 matches
Mail list logo