2

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>
3

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>
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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