Syntax for ETag?

Try ETag: “4ae413bd”. The value of an ETag must follow the ABNF form: entity-tag = [ weak ] opaque-tag weak = “W/” opaque-tag = quoted-string quoted-string = ( <“> *(qdtext | quoted-pair ) <“> ) qdtext = <any TEXT except <“>> quoted-pair = “\” CHAR CHAR = <any US-ASCII character (octets 0 – 127)> TEXT … Read more

Which one to use : Expire Header, Last Modified Header or ETags

Expires and Cache-Control are “strong caching headers” Last-Modified and ETag are “weak caching headers” First the browser checks Expires/Cache-Control to determine whether or not to make a request to the servers. If it has to make a request, it will send Last-Modified/ETag in the HTTP request. If the Etag value of the document matches that, … Read more

Getting ETags right

ETag is similar to the Last-Modified header. It’s a mechanism to determine change by the client. An ETag needs to be a unique value representing the state and specific format of a resource (a resource could have multiple formats that each need their own ETag). Not unique across the entire domain of resources, simply within … Read more

How do I support ETags in ASP.NET MVC?

@Elijah Glover’s answer is part of the answer, but not really complete. This will set the ETag, but you’re not getting the benefits of ETags without checking it on the server side. You do that with: var requestedETag = Request.Headers[“If-None-Match”]; if (requestedETag == eTagOfContentToBeReturned) return new HttpStatusCodeResult(HttpStatusCode.NotModified); Also, another tip is that you need to … Read more

What takes precedence: the ETag or Last-Modified HTTP header?

According to RFC 2616 – section 13.3.4, an HTTP 1.1 Client MUST use the ETag in any cache-conditional requests, and if both an ETag and Last Modified are present, it SHOULD use both. The ETag header is considered a strong validator (see section 13.3.3), unless explicitly declared weak by the server, whereas the Last Modified … Read more