I can't get Tomcat to send images with the correct expires definition. The browser keep sending get requests for images already downloaded and Tomcat responds with 304. What I would want is that Tomcat will respond to the initial request with proper expires header and without any Last-modified header so the browser will use local cache until the file expires without going to the server each page load to see if the image had changed.
I have the following definition in my web.xml file:
<filter>
<filter-name>ExpiresFilter</filter-name>
<filter-class>org.apache.catalina.filters.ExpiresFilter</filter-class>
<init-param>
<param-name>ExpiresByType image</param-name>
<param-value>access plus 1 weeks</param-value>
</init-param>
<init-param>
<param-name>ExpiresByType text/css</param-name>
<param-value>modification plus 0 minutes</param-value>
</init-param>
<init-param>
<param-name>ExpiresByType application/javascript</param-name>
<param-value>modification plus 0 minutes</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>ExpiresFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
Any idea?