Configure Entity Tags (ETags) by htaccess Code

Configure Entity Tags (ETags)

Disable ETags

code

  1. <IfModule mod_headers.c>
  2.     Header unset ETag
  3. </IfModule>
  4. FileETag None

Enable Cache-Control and Unset ETag

code

  1. <IfModule mod_headers.c>
  2.    
  3.     Header unset ETag
  4.     <filesMatch "\.(css)$">
  5.         Header set Cache-Control "max-age=604800, public"
  6.     </filesMatch>
  7.     <filesMatch "\.(js)$">
  8.         Header set Cache-Control "max-age=216000, private"
  9.     </filesMatch>
  10.     <filesMatch "\.(x?html?|php)$">
  11.         Header set Cache-Control "max-age=420, private, must-revalidate"
  12.     </filesMatch>
  13.     <filesMatch "\.(ico|jpe?g|png|gif|swf)$">
  14.         Header set Cache-Control "max-age=2592000, public"
  15.     </filesMatch>
  16. </IfModule>

About webfriendy

Sumit Malviya | Web developer and Blogger

View all posts by webfriendy →

Leave a Reply

Your email address will not be published. Required fields are marked *