Add Support for Weak ETags

Aaron Peschel aaron.peschel at
Fri Oct 25 21:06:44 UTC 2013

This is a response to rev 4746 which removed ETags. 4746 removes the ETag field
from the header in all instances where content is modified by the web server
prior to being sent to the requesting client. This is far more stringent than
required by the HTTP spec.

The HTTP spec requires that strict ETags be dependent on the variant that is
returned by the server. While removing all ETags from these variants
*technically* meets the spec, it is a bit extreme.

This commit modifies the ngx_http_clear_etag macro to check if the ETag is
marked as a weak ETag. IFF that case, the ETag is retained, and not dropped.

Longer term, a better solution would be to completely remove
ngx_http_clear_strict_etag and replace it with functions to generate a strict
ETag for a variant prior to sending a response to the client, provided that
there is not a weak ETag field already included.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: application/octet-stream
Size: 5845 bytes
Desc: not available
URL: <>

More information about the nginx-devel mailing list