{"id":985,"date":"2010-10-09T00:27:36","date_gmt":"2010-10-09T00:27:36","guid":{"rendered":"http:\/\/www.phpmind.com\/blog\/?p=985"},"modified":"2010-10-09T00:30:59","modified_gmt":"2010-10-09T00:30:59","slug":"how-to-disable-etags-through-htaccess","status":"publish","type":"post","link":"https:\/\/www.phpmind.com\/blog\/2010\/10\/how-to-disable-etags-through-htaccess\/","title":{"rendered":"How to add and disable ETags through .htaccess?"},"content":{"rendered":"<p><strong>What is ETag?<\/strong><br \/>\nAn ETag, or entity tag, is part of HTTP and it provides a unique identifier for the resource being supplied.<\/p>\n<p>This identifier can then be used to validate if it resource has been modified or<br \/>\nBrowser requests can use an etag and an if-match header to check whether a resource has been modified since it was served, providing an efficient caching facility that relies on content rather than on timeouts.<\/p>\n<p>Use this code to setup ETags on your server, using following htaccess.<\/p>\n<pre lang=\"php\">\r\n\r\nFileETag MTime Size\r\n<ifmodule mod_expires.c>\r\n  <filesmatch \"\\.(jpg|gif|png|css|js)$\">\r\n       ExpiresActive on\r\n       ExpiresDefault \"access plus 1 year\"\r\n   <\/filesmatch>\r\n<\/ifmodule>\r\n\r\n\r\n<\/pre>\n<p>Sometimes developer want to be disable ETags from headers. To disable ETags, make sure to include following snippet in your .htaccess file.<\/p>\n<pre lang=\"php\">\r\n\r\nHeader unset ETag\r\nFileETag None\r\n\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-full wp-image-986\" title=\"phpmind-etag\" src=\"http:\/\/www.phpmind.com\/blog\/wp-content\/uploads\/2010\/10\/phpmind-etag.jpg\" alt=\"\" width=\"325\" height=\"398\" srcset=\"https:\/\/www.phpmind.com\/blog\/wp-content\/uploads\/2010\/10\/phpmind-etag.jpg 325w, https:\/\/www.phpmind.com\/blog\/wp-content\/uploads\/2010\/10\/phpmind-etag-244x300.jpg 244w\" sizes=\"auto, (max-width: 325px) 100vw, 325px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>What is ETag? An ETag, or entity tag, is part of HTTP and it provides a unique identifier for the resource being supplied. This identifier can then be used to validate if it resource has been modified or Browser requests can use an etag and an if-match header to check whether a resource has been [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[33,3],"tags":[],"class_list":["post-985","post","type-post","status-publish","format-standard","hentry","category-htaccess","category-php"],"_links":{"self":[{"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/posts\/985","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/comments?post=985"}],"version-history":[{"count":5,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/posts\/985\/revisions"}],"predecessor-version":[{"id":991,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/posts\/985\/revisions\/991"}],"wp:attachment":[{"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/media?parent=985"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/categories?post=985"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/tags?post=985"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}