Trying to implement "future expiration date" for static files in django
I am trying to use the future future expires method to shorten my site load times.
However, when I access the static files in firefox, the server still responds with HTTP / 1.x 304 NOT MODIFIED. Shouldn't the request be made if the files are cached correctly?
Here are the relevant httpd.conf lines I have for apache 2.2:
LoadModule expires_module modules/mod_expires.so LoadModule headers_module modules/mod_headers.so <FilesMatch "\.(ico|pdf|flv|jpe?g|png|gif|js|css|swf)$"> ExpiresActive On ExpiresDefault "access plus 1 year" </FilesMatch>
YSlow says none of the static files have a distant future expiration date. Does anyone know what I am doing wrong?
I'm not sure if it belongs
in the FilesMatch directive. I have the same thing implemented and I pulled it out.
From the docs, it looks like it doesn't belong:
I have an expires header set in directories with static files:
ExpiresActive On <Directory /path/to/static/files> ExpiresDefault "access plus 6 months" Header append Cache-Control public </Directory>
source to share