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