なんとな~くしあわせ?の日記

「そしてそれゆえ、知識そのものが力である」 (Nam et ipsa scientia potestas est.) 〜 フランシス・ベーコン

HTTP GETの容量制限とか

Is there a limit to the length of a GET request?

stackoverflow.com

やはりStackOverflowは有能すぎる。

ぼくの推しアンサーはこれ
http://stackoverflow.com/a/266341/2565527

Not in the RFC, no, but there are practical limits.
RFC内には指定は無いが、実際的な制限はある)

The HTTP protocol does not place any a priori limit on the length of a URI. Servers MUST be able to handle the URI of any resource they serve, and SHOULD be able to handle URIs of unbounded length if they provide GET-based forms that could generate such URIs. A server SHOULD return 414 (Request-URI Too Long) status if a URI is longer than the server can handle (see section 10.4.15).
(HTTPプロトコルURIの長さに先験的な制限は設けない。サーバは自身が扱うどのようなURIのリソースについても処理できなければならない、そしてそのようなURIから生成されうるGETベースのフォームから与えられた無限の長さのURIを扱えるべきである。サーバはサーバが扱えるサイズより大きなURIを与えられた時は、ステータスコード414(Request-URI Too Long)を返すべきである

Note: Servers should be cautious about depending on URI lengths above 255 bytes, because some older client or proxy implementations may not properly support these lengths.
(メモ:サーバは255byte以上の長さのURIについては慎重になるべきである。なぜなら、古めのクライアントやプロキシの実装はこれらのデータ長をちゃんとサポートしてないかもしれないからだ。)

プロキシはどうなんだろう?

Proxyサーバとして有名なSquidは、以下のような感じだ
request_header_max_size

ヘッダーのデフォルト最大サイズが64KBなので、だいぶ小さい。
Proxyを事務所内で設定する時は気をつけるべきかもしれない。

デフォルト値: request_header_max_size 64 KB

これはリクエスト中のHTTPヘッダーの最大サイズを指定します。
リクエストヘッダは通常は比較的小さい。(約 512 bytes).
リクエスト·ヘッダサイズに制限を行うと、特定のバグ(たとえば持続的な接続)や、バッファオーバーフローやサービス拒否攻撃(denial-of-service attacks)をキャッチします。