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 during the request chain and once during the
response chain, therefore, anything I add is in their twice.

If I use

response.setHeader(headerName, fc.getInitParameter(headerName));

It will overwrite the current setting, but setting the value twice just
seems like bad form. If I could detect which chain is currently being
processed then I could only insert it once.

Thanks,

Keith

-----Original Message-----
From: Keith Bottner [mailto:[EMAIL PROTECTED] 
Sent: Friday, July 30, 2004 7:53 AM
To: [EMAIL PROTECTED]
Subject: How do you set cache-control for static (gif, jpg) resources


I am trying to find out how I can set my static content for images,
javascript and css to have a different cache-control setting. It appears
that Tomcat always returns Cache-Control: no-cache with every response. I
want to specify certain static resources such as gif and jpg to have
Cache-Control: public,max-age=7200.
 
Does anyone know how to configure Tomcat to do this? I have Googled
everywhere with no luck!
 
Keith


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to