From 480e142d866941b296638654702b976620ed21ec Mon Sep 17 00:00:00 2001 From: Mark Pilgrim Date: Sat, 7 Nov 2009 00:32:45 +0100 Subject: [PATCH] add note on Etags differing between compressed and uncompressed versions of the same resource [thanks mnot] --- http-web-services.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/http-web-services.html b/http-web-services.html index eafdf49..f0e8093 100755 --- a/http-web-services.html +++ b/http-web-services.html @@ -161,6 +161,10 @@ Cache-Control: max-age=31536000, public

HTTP supports several compression algorithms. The two most common types are gzip and deflate. When you request a resource over HTTP, you can ask the server to send it in compressed format. You include an Accept-encoding header in your request that lists which compression algorithms you support. If the server supports any of the same algorithms, it will send you back compressed data (with a Content-encoding header that tells you which algorithm it used). Then it’s up to you to decompress the data. +

+

Important tip for server-side developers: make sure that the compressed version of a resource has a different Etag than the uncompressed version. Otherwise, caching proxies will get confused and may serve the compressed version to clients that can’t handle it. Read the discussion of Apache bug 39727 for more details on this subtle issue. +

+

Python’s HTTP libraries do not support compression, but httplib2 does.

Redirects