tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kristján Bjarni Guðmundsson <>
Subject RE: How to remove http headers?
Date Fri, 11 Apr 2003 15:56:06 GMT
"Shapira, Yoav" <> wrote on 11.04.2003 12:55:17:

> Howdy,
> >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
> Tomcat doesn't automatically add these AFAIK, except possibly the 3rd
> header. 
> My guess is something else in your network adds these.

I beg to differ. I am running the server and browser on the same machine
and I am using TCPMonitor to examine the connection.
I am using Apache Tomcat/4.1.24-LE-jdk14.

This does not happen with normal unsecure files, only secure files.
You can test this yourself with for example the manager application.

> >So how can I do that? There is no removeHeader() function in the
> servlet
> >api.
> There's no removeHeader, but there's addHeader, which you can use
> multiple times, overriding the old value if it exists.  So you can add a
> "Pragma" header with "cache-always" or whatever other value you want,
> overriding the above.

Well "Cache-Control" is no problem I can modify that to "public" or 

However "Pragma" has only one valid value: "no-cache"
So you really can't modify it to something else.
And also any of this isn't really useful when there is also
an "Expires" header and I can't modify that value since I have
no idea when the file will expire in the future.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message