Subject: [hybi] "Cache-Control: no-cache" may improve handshake success rate

From: Takeshi Yoshino <[email-masked]>
Date: Mon, 1 Oct 2012 14:32:49 +0900

It seems adding the Cache-Control header to the WebSocket handshake
improves success rate for some environment.

We've investigated one bug report [1] for Chrome, and found that there're
some caches deployed in Thailand which corrupt server's opening handshakes
by replacing the value in the Connection header with close.

This doesn't happen if Firefox is used. Some tests using reduced header set
indicated that it's because Firefox puts the Cache-Control and Pragma
header like this:

Pragma: no-cache
Cache-Control: no-cache

in its WebSocket client's handshakes while Chrome does not send such
headers.

I guess that the proxy is caching server's opening handshake and sending
the cached data but after overwriting the Connection header ignoring the
meaning of "Connection: Upgrade".

Basically, we want Upgrade non-compliant proxies to be replaced with new
ones rather than taking work around, but don't have much reluctance to use
of the headers.

----

[1] http://code.google.com/p/chromium/issues/detail?id=148908. Thanks
bangkokmaco.