O'Reilly logo

High Performance Web Sites by Steve Souders

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

ETags in the Real World

Table 15-1 shows that 6 out of 10 top U.S. web sites use ETags on a majority of their components. To be fair, three of them have modified the ETag format to remove inode (Apache) or ChangeNumber (IIS). Four or more contain ETags that haven't been modified and therefore cause the performance problems discussed previously.

Table 15-1. ETags observed across 10 top web sites

Web Site

Components with ETags

Fixed

http://www.amazon.com

0% (0/24)

n/a

http://www.aol.com

5% (3/63)

yes

http://www.cnn.com

83% (157/190)

no

http://www.ebay.com

86% (57/66)

no

http://www.google.com

0% (0/5)

n/a

http://www.msn.com

72% (42/58)

no

http://www.myspace.com

84% (32/38)

yes and no

http://www.wikipedia.org

94% (16/17)

unknown

http://www.yahoo.com

0% (0/34)

n/a

http://www.youtube.com

70% (43/61)

yes

An example of a component with different ETags across the cluster of servers is http://stc.msn.com/br/hp/en-us/css/15/blu.css from http://msn.com. The HTTP headers from the first request in the example contains an ETag value of 80b31d5a4776c71:6e0.

GET /br/hp/en-us/css/15/blu.css HTTP/1.1
Host: stc.msn.com

HTTP/1.1 200 OK
Last-Modified: Tue, 03 Apr 2007 23:25:23 GMT
ETag: "80b31d5a4776c71:6e0"
Content-Length: 647
Server: Microsoft-IIS/6.0

On the first reload, the ETag matches and a 304 response is sent. The Content-Length header is missing from the response because the 304 status code tells the browser to use the content from its cache.

GET /br/hp/en-us/css/15/blu.css HTTP/1.1 Host: stc.msn.com If-Modified-Since: Tue, 03 Apr ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required