Philip Jacob

Flickr Sends Goofy HTTP Headers

· Philip Jacob

Flickr is sending the following HTTP headers when I request an image from their site:

<http://static.flickr.com/25/45701618_b33d84770b_s.jpg>

GET /25/45701618_b33d84770b_s.jpg HTTP/1.1

Host: static.flickr.com

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6

Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5

Accept-Language: en-us,en;q=0.5

Accept-Encoding: gzip,deflate

Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7

Keep-Alive: 300

Connection: keep-alive

Cookie: cookie_epass=9df5184c71b811e5bf1081de83e24d51; cookie_accid=16665; cookie_session=16665%3A9df5184c71b811e5bf1081de83e24d51; use_master_until=1127567132

Pragma: no-cache

Cache-Control: no-cache

HTTP/1.x 200 OK

Date: Fri, 23 Sep 2005 01:13:26 GMT

Server: Apache/2.0.52 (Red Hat)

Last-Modified: Fri, 23 Sep 2005 01:13:23 GMT

Etag: “91e011-d08-1dacd2c0”

Accept-Ranges: bytes

Content-Length: 3336

Content-Type: image/jpeg

X-Cache: HIT from storage7.flickr.mud.yahoo.com

Connection: close

This is completely valid HTTP, but I really wish they were sending back a proper Expires header like this:

Expires: Mon, 24 Oct 2005 15:12:45 GMT

If they sent back this HTTP header, my browser wouldn’t have to perform conditional-GET requests for subsequent loads of images on Flickr. The part of the HTTP request that makes the GET conditional is highlighted below:

`GET /25/45701618_b33d84770b_s.jpg HTTP/1.1

Host: static.flickr.com

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6

Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,/;q=0.5

Accept-Language: en-us,en;q=0.5

Accept-Encoding: gzip,deflate

Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7

Keep-Alive: 300

Connection: keep-alive

Cookie: cookie_epass=9df5184c71b811e5bf1081de83e24d51; cookie_accid=16665; cookie_session=16665%3A9df5184c71b811e5bf1081de83e24d51; use_master_until=1127567132

If-Modified-Since: Fri, 23 Sep 2005 01:13:23 GMT

If-None-Match: “91e011-d08-1dacd2c0”

Cache-Control: max-age=0`

HTTP/1.x 304 Not Modified

Date: Sat, 24 Sep 2005 15:19:32 GMT

Server: Apache/2.0.52 (Red Hat)

Etag: “91e011-d08-1dacd2c0”

X-Cache: MISS from storage7.flickr.mud.yahoo.com

Connection: close

Instead, my browser would notice that it has been told not to request this resource until Oct 24th, which is exactly one month from today and would display th e image from the local browser cache. There wouldn’t be any network overhead at all and Flickr images would be served a lot faster.

I don’t see what the point of only allowing conditional GET requests is. Flickr isn’t benefitting anybody by doing this. Failing to use Expires: headers for static content only serves to slow down the user experience and increase load on their systems.

Sysadmins at Flickr: read the mod_expires documentation and switch this thing on.