Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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"
 </FilesMatch>
</IfModule>

<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
</IfModule>

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 -- httpd.apache.org/docs/current/mod/core.html#fileetag –  LazyOne Aug 26 '11 at 8:08
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.