Bug #1800

Invalid etag generated by mod_compress

Added by Aragon about 6 years ago. Updated almost 6 years ago.

Status:FixedStart date:2008-10-16
Priority:HighDue date:
Assignee:-% Done:

100%

Category:mod_compress
Target version:-
Missing in 1.5.x:

Description

With mod_compress enabled, invalid ETags are generated for compressed variants of the same resource. Some examples:

# curl -D - -o /dev/null -H 'Accept-Encoding: gzip' http://localhost:81/test.txt
HTTP/1.1 200 OK
Vary: Accept-Encoding
Content-Encoding: gzip
Last-Modified: Thu, 16 Oct 2008 03:00:59 GMT
ETag: "1755605059" 
Content-Type: text/plain
Accept-Ranges: bytes
Content-Length: 60
Date: Thu, 16 Oct 2008 03:11:52 GMT
Server: lighttpd/1.4.20
# curl -D - -o /dev/null -H 'Accept-Encoding: deflate' http://localhost:81/test.txt
HTTP/1.1 200 OK
Vary: Accept-Encoding
Content-Encoding: deflate
Last-Modified: Thu, 16 Oct 2008 03:00:59 GMT
ETag: "1755605059" 
Content-Type: text/plain
Accept-Ranges: bytes
Content-Length: 42
Date: Thu, 16 Oct 2008 03:13:37 GMT
Server: lighttpd/1.4.20
# curl -D - -o /dev/null http://localhost:81/test.txt
HTTP/1.1 200 OK
Vary: Accept-Encoding
Content-Type: text/plain
Accept-Ranges: bytes
ETag: "1755605059" 
Last-Modified: Thu, 16 Oct 2008 03:00:59 GMT
Content-Length: 25600
Date: Thu, 16 Oct 2008 03:14:27 GMT
Server: lighttpd/1.4.20

The ETag values in the above examples are all identical regardless of the fact that each entity is a different variant.

This behaviour is in violation of RFC2616 #3.11:

An entity tag MUST be unique across all versions of all entities associated with a particular resource.

Associated revisions

Revision 2386
Added by stbuehler almost 6 years ago

Use modified etags in mod_compress (fixes #1800)

History

#1 Updated by stbuehler almost 6 years ago

I guess i should reread the rfc; but imho the etag should be independent of the transfer encoding.

#2 Updated by Aragon almost 6 years ago

The ETag is a single tag for performing entity variant comparisons. Without it caches would have to compare entity encodings, languages, character sets, etc. between variants. That's why each entity variant must have a unique entity tag.

#3 Updated by stbuehler almost 6 years ago

  • Status changed from New to Fixed
  • % Done changed from 0 to 100

Applied in changeset r2386.

Also available in: Atom