Add expires header with Apache


/ Published in: Apache
Save to your folder(s)

ExpiresActive tells the apache2 to use the expires module.

ExpiresDefault specifies the expire date for all mime-types in this directory.

ExpiresByType specifies the expires date for the specified mime-type in this directory.


Copy this code and paste it in your HTML
  1. <IfModule mod_expires.c>
  2. ExpiresActive on
  3. ExpiresByType image/gif “access plus 2 years”
  4. ExpiresDefault ”access plus 1 days”
  5. </IfModule>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.