{"id":1630,"date":"2012-08-16T14:59:21","date_gmt":"2012-08-16T13:59:21","guid":{"rendered":"http:\/\/mccltd.net\/blog\/?p=1630"},"modified":"2012-08-16T15:08:03","modified_gmt":"2012-08-16T14:08:03","slug":"http-cache-control-the-etag","status":"publish","type":"post","link":"http:\/\/darenmatthews.com\/blog\/?p=1630","title":{"rendered":"HTTP Cache Control and the ETag"},"content":{"rendered":"<div id=\"attachment_1614\" style=\"width: 69px\" class=\"wp-caption alignright\"><a href=\"http:\/\/www.cloudshark.org\/captures\/47dcd308addf\" target=\"_blank\"><img aria-describedby=\"caption-attachment-1614\" loading=\"lazy\" class=\"size-full wp-image-1614      \" title=\"HTTP IfModifiedSince and ETag\" src=\"http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2011\/05\/CloudShark-Logo.PNG\" alt=\"CloudShark-Logo\" width=\"59\" height=\"49\" \/><\/a><p id=\"caption-attachment-1614\" class=\"wp-caption-text\">HTTP and ETag<\/p><\/div>\n<p><strong>Download this capture file:<\/strong> &#8221; <a href=\"http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2012\/08\/IfModifieldSince_and_ETag.pcap\">IfModifieldSince_and_ETag<\/a> &#8221;<\/p>\n<p>OR: view it now via <strong><a title=\"HTTP IfModifedSince and ETag\" href=\"http:\/\/www.cloudshark.org\/captures\/47dcd308addf\" target=\"_blank\">Cloudshark<br \/>\n<\/a><\/strong><\/p>\n<p><strong>With caching enabled,<\/strong> a web server does not need to send a full response if content has not changed.<\/p>\n<ul>\n<li><em>If-Modified-Since<\/em> is an HTTP request header that the client sends to your browser along with a request for content.<\/li>\n<li><em>Last-Modified<\/em> is an HTTP response header that the server returns along with the requested content.<\/li>\n<\/ul>\n<p>If-Modified-Since \tAllows a 304 Not Modified to be returned if content is unchanged<br \/>\n<code>If-Modified-Since: Sat, 29 Oct 1994 19:43:31 GMT<\/code><\/p>\n<p>If-None-Match \tAllows a 304 Not Modified to be returned if content is unchanged,<br \/>\n<code>If-None-Match: \"737060cd8c082f209582d\"<\/code><!--more--><\/p>\n<p><span style=\"text-decoration: underline;\"><strong>The HTTP ETag <\/strong><\/span><\/p>\n<p>An ETag or The Entity Tag (Etag) assists web cache validation,  allowing a client to make conditional requests. ETags are similar to  fingerprints, and they can be quickly compared to determine if two  versions of a resource are the same or not.<\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2012\/08\/If-Mofified-Since_and_Etag.PNG\"><img loading=\"lazy\" class=\"size-full wp-image-1631 aligncenter\" title=\"If-Mofified-Since_and_Etag\" src=\"http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2012\/08\/If-Mofified-Since_and_Etag.PNG\" alt=\"If-Mofified-Since_and_Etag\" width=\"472\" height=\"241\" srcset=\"http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2012\/08\/If-Mofified-Since_and_Etag.PNG 472w, http:\/\/darenmatthews.com\/blog\/wp-content\/uploads\/2012\/08\/If-Mofified-Since_and_Etag-300x153.PNG 300w\" sizes=\"(max-width: 472px) 100vw, 472px\" \/><\/a><\/p>\n<p>ETags can use both strong and weak validation, distinguished by the presence of an initial &#8220;W\/&#8221; in the ETag identifier:<\/p>\n<blockquote><p>&#8220;123456789&#8221;   &#8212; A strong ETag validator<br \/>\nW\/&#8221;123456789&#8243;  &#8212; A weak ETag validator<\/p><\/blockquote>\n<p>Strongly validated ETags ensure content is byte-for-byte identical, as well as all other entity fields (such as Content-Language) remain unchanged. (Strong ETags permit the caching and reassembly of partial responses, as with byte-range requests).<\/p>\n<p>Weakly validatind ETags claim that the resources at the URL are semantically equivalent; meaning that for practical purposes they are interchangeable and that cached copies can be used. However the resources are not necessarily byte-for-byte identical.<\/p>\n<p><strong>THUS:<\/strong><\/p>\n<ul>\n<li> Weak ETags are not suitable for byte-range requests.<\/li>\n<li> Weak ETags may be useful for cases in which strong ETags are impractical for a web server to generate, such as with dynamically-generated content.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Download this capture file: &#8221; IfModifieldSince_and_ETag &#8221; OR: view it now via Cloudshark With caching enabled, a web server does not need to send a full response if content has not changed. If-Modified-Since is an HTTP request header that the client sends to your browser along with a request for content. Last-Modified is an HTTP [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[53],"tags":[60,37],"_links":{"self":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1630"}],"collection":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1630"}],"version-history":[{"count":6,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1630\/revisions"}],"predecessor-version":[{"id":1737,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1630\/revisions\/1737"}],"wp:attachment":[{"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1630"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1630"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/darenmatthews.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1630"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}