[PHP-users 1725] Re: GETで送れるデータの大きさは

まつなみ php-users@php.gr.jp
Mon, 03 Sep 2001 13:13:06 +0900


こんにちは、松並と申します。

答えにはなりませんが私も興味ありまして・・・

> この際、URLの長さとしては、どのぐらいまで許されるものなので
> しょうか。

RFC2068的には
http://www.csl.sony.co.jp/cgi-bin/hyperrfc?rfc2068.txt
3.2.1 General Syntaxにて

(引用開始)
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).
(引用終了)

URIの長さ制限は決めてないみたいですね。
しかも「サーバは提供するリソース(サービス)に必要な長さのURIを
正しく扱えないといけない」ことになってるようです。
※Webサーバを実装する人は大変そうですね:->

> ブラウザの制限もあると思いますし、Webサーバの制限もあると思
> います。どのぐらいを上限として設定するのが妥当なのでしょう
> か。

さらにRFCの同じ個所に次のように記述されています。

(引用開始)
  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.
(引用終了)

255バイト以上のURLは古いブラウザとかプロキシでは正しく動作しないものが
あるらしいですね。

てことは目安として255バイトなのでしょうか。
でも、255バイトだと用途にもよりますが足りないことも多いと思いますね。
携帯電話だとURIの長さ制限が厳しいかもしれませんね。(よく知りません)

具体的な数値の目安は私も知りたいです。

-- 
まつなみ <mat@abelia.ocn.ne.jp>
http://putyou.matwerks.com/