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 have a folder with javascript files that should expire faster than the normal scripts.

Is it possible to let files expire per directory using Apache 2 other than .htaccess?

<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType text/javascript "access plus 60 minutes"
</IfModule>
share|improve this question

1 Answer 1

up vote 2 down vote accepted

According to the documentation you can put these directives into a <Directory> tag in your apache configuration: mod_expires#ExpiresActive

For example like this:

<Directory /var/www/js/expire_fast>
  <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType text/javascript "access plus 60 minutes"
  </IfModule>
</Directory>
share|improve this answer
    
ah, thanks. i forgot :) –  Martin Dec 31 '13 at 12:55

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.