Sunday, September 2, 2018

What is the maximum length of a URL in a browser?

Since the web runs on links, it is worth while to know the max length of a link : there is no limit at all in the specification. But, browsers will have limits.

The exact specification reads :

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.

(Source: http://www.faqs.org/rfcs/rfc2616.html)

However, Microsoft Internet Explorer only can handle around 2,000 characters. (Source: https://support.microsoft.com/en-us/help/208427/maximum-url-length-is-2-083-characters-in-internet-explorer)

More than that, a webpage whose url is 2,000 characters will take longer to load than one whose length is 20 characters. At the very least, because your computer needs to download 1,980 characters less.

In terms of networking, domain lookup times, or file lookup times, longer names similarly slow things down. Additionally, search engines dislike overly long URLs, so, if SEO is important, try to keep to a limit of 100 or fewer characters.

No comments:

Post a Comment