Jump to content

Caching Only Seems To Be Partially Working?


minerbog

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)

post-89377-0-80510000-1326045986_thumb.png

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

smile.gif

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...