Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using .htaccess code like

<IfModule mod_headers.c>
 <FilesMatch "\.(gif|jpg|png|css|swf|php)$">
  Header add "Expires" "Mon, 28 Jul 2014 23:30:00 GMT"
  Header add "Cache-Control" "max-age=31536000"

<IfModule mod_expires.c>
 ExpiresActive On
 ExpiresDefault A604800
 ExpiresByType text/css A604800
 ExpiresByType image/gif A604800
 ExpiresByType image/png A604800
 ExpiresByType image/jpeg A604800
 ExpiresByType application/x-shockwave-flash A604800

The problem is that it still checks the server if the file has been modified and then returns 304 Not Modified. I want it to use cache by default i.e. the local browser cache and not make a round trip to the server at all.

Any suggestions?

share|improve this question
Do you have ETag present as well? – LazyOne Aug 25 '11 at 15:07
How do you switch off ETag – elated Aug 26 '11 at 7:16
FileETag None -- – LazyOne Aug 26 '11 at 8:08

You can't force a client to do what you want. All things given in your configuration are "optional recommendations" for a client. You only have control over the server and have no influence on the client's behavior even if you give them advices.

share|improve this answer
@Rolando Cruz: Please do not edit someone else's post for content. – Chris S Aug 25 '11 at 15:32
I understand that. But most browsers will follow these recommendations. Am not saying that all browsers have to follow it. – elated Aug 26 '11 at 7:17

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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