Jump to content

Caching Only Seems To Be Partially Working?


Recommended Posts

Hi All,

It my first ever post here so sorry if I slip up!! Been using w3schools site for ages and didn't even realise they had a forum! Opps :|

Anyway, my problem is this. I have created the htaccess files as below for my website for cache all the static files for on month using mod expires. I have checked with my hosting company and mod_expires & mod_headers are both active on my server. For some reason though it doesn't seem to be working as I would expect?

Here is a copy of my htaccess file :

<IfModule mod_expires.c>ExpiresActive OnFileETag none# Set Expires Headers<FilesMatch “\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$”>Header set Expires A2419200</FilesMatch></IfModule>

<IfModule mod_headers.c>

ExpiresActive OnFileETag none# Set Expires Headers<FilesMatch “\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$”>Header set Cache-Control “max-age=2419200”</FilesMatch></IfModule>Basically, every item listed has a cache dated 1 month in the future.

When I check this with firebug, the page loads as normal. Then I navigate elsewhere on the site. The images don’t even request (which is correct) but the css checks and downloads with a 200OK response even though it shows that the current cache doesn’t expire until a months time?? (See attached screenshot)


But if I hit refresh the css file returns a 304 Not-Modified response but don’t download??

Please help! Why are my css caches not working as they should yet the images chache are fine!?!!

Many Thanks


Edited by minerbog
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...