You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Kristján Bjarni Guðmundsson <kr...@hugvit.is> on 2003/01/14 16:55:51 UTC

How can I clear response headers?

I have created a servlet that serves both html and images, I set the 
ContentType and everything is okay.
However I have noticed whenever I use BASIC authentication on this servlet 
Tomcat automatically adds these
to the response header:

Pragma: No-cache
Cache-Control: no-cache
Expires: Thu, 01 Jan 1970 00:00:00 GMT

I understand that this should be used when you are serving html so that 
its not cached, however
I would like to remove these headers when I am serving images since they 
should be cached.
But alas there is no clearHeader() only setHeader() in 
HttpServletResponse.
How can I do this?

 - Kristján