Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the maximum length of referer? [duplicate]

Tags:

http

Possible Duplicate:
What is the maximum length of a URL?

Hello, I want to log referer into my database , I want to know what the maximum length is for referer ?

like image 825
gwt Avatar asked Aug 03 '12 15:08

gwt


1 Answers

The referer is a URL, so you can refer to this answer about maximum URL lengths. URLs will almost certainly be no more than 2083 characters in length, as this is the maximum supported by some versions of IE, and it looks like Google doesn't index anything over 1855 characters.

So if you're storing as a CHAR then go for 2083 to be safe, and if you're storing as a VARCHAR then it really doesn't matter since any string over 255 characters takes 2 bytes to store its length so go for something high like 3000.

like image 156
James Avatar answered Sep 23 '22 14:09

James