You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by ju...@entory.com on 2005/07/06 16:46:35 UTC

Caching static content

Hello

How to set the HTTP-Header Cache-Control:max-age=3600 in the Response of an
image file?

Here I will describe what I did:

I implemented a  Filter that added the header
      response.setHeader("Cache-Control", "max-age=3600");

This works, but not in every case. The first request for an image, that
return HTTP Code 200 (OK) and the image itself, the header is NOT set. The
second or third request for the same image return Code 304 (Not modified),
the header contains Cache-Control:max-age=3600.

Is there a dependency to the HTTP return code? How to supress the second
and third requests?

Regards,
Jürgen Dufner



-----------------------------------------
Diese E-Mail enthaelt vertrauliche oder rechtlich geschuetzte
Informationen.
Wenn Sie nicht der beabsichtigte Empfaenger sind, informieren Sie bitte
sofort den Absender und loeschen Sie diese E-Mail. Das unbefugte
Kopieren
dieser E-Mail oder die unbefugte Weitergabe der enthaltenen
Informationen
ist nicht gestattet.

The information contained in this message is confidential or protected
by
law. If you are not the intended recipient, please contact the sender
and
delete this message. Any unauthorised copying of this message or 
unauthorised distribution of the information contained herein is
prohibited.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org