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 <kb...@hugvit.is> on 2003/04/11 12:38:05 UTC

How to remove http headers?

I have a servlet that is generating html and gif files and it is protected 
with basic authentication.
Tomcat seems to automatically add these header to the response:

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

This makes sense when you are delivering html since you dont' want to 
store the secure
pages in the cache, however for gif files you sometimes want to store 
these for all users
even though it is through a secure connection, basically I would like to 
have the option of
either removing these headers or stop tomcat from adding them in the first 
place.

So how can I do that? There is no removeHeader() function in the servlet 
api.