I'm running apche2 and tomcat6 both on port 80 with mod_jk setup on ubuntu servers(8.10,9.10). Tomcat is being used for serving jsp pages. I've a small problem with the IE browser which doesn't cache but just reload all the images(jpg|png|css) when refreshed the page which is not happing with the other browsers. I also tried appending the following in the apache config file but no change.

<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"
    ExpiresByType image/gif "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"
    ExpiresByType image/css "access plus 1 month"
    ExpiresByType text/html "access plus 1 month"

/etc/apache2/apache2.conf file:

Alias / /var/www/
ErrorDocument 503 /maintenance.html
ErrorDocument 404 /maintenance.html
JkMount / myworker
JkMount /* myworker
JkMount /*.jsp myworker
JkUnMount /*.html myworker

<VirtualHost *:80>
ServerName station1.mydomain.com
DocumentRoot /usr/share/tomcat/webapps/myapps1
        JkMount /* myworker
        JkUnMount /*.html myworker

<VirtualHost *:80>
ServerName station2.mydomain.com
DocumentRoot /usr/share/tomcat/webapps/myapps2
        JkMount /* myworker
    JkMount /*.html myworker

Anybody has any trick to make IE cache and not to reload all the images everytime?


We didn't have much luck getting IE to cache until adding something like this to the apache configuration for files matching images and stylesheet extensions:

Header add Cache-Control "max-age=28800, public"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.