What is the optimum limit for URL length? 100, 200+

后端 未结 11 1948
抹茶落季
抹茶落季 2021-01-05 14:17

I have an ASP.Net 3.5 platform and windows 2003 server with all the updates.

There is a limit with .Net that it cannot handle more than 260 characters. Moreover if

11条回答
  •  無奈伤痛
    2021-01-05 14:57

    Define "optimum" for your application.

    The HTTP standard has a limit (it depends on your application):

    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).

      Note: Servers ought to be cautious about depending on URI
      lengths above 255 bytes, because some older client or proxy
      implementations might not properly support these lengths.
    

    So the question is - what is the limit of your program, or what is the maximum resource identifier size your program needs to perform all its functionality?

    Your program should have a natural limit.

    If it doesn't you might as well stick it as 16k, as you don't have enough information to define the problem.

    -Adam

提交回复
热议问题