I would like to use the location.hash
to encode the state of my client app, such that users can easily bookmark and/or share the app in its complete state using the URL.
There are a number of (outdated) topics on the max length of a url, particularly limits in internet explorer. However it is not clear what the maximum size of the location.hash
is. Because the hash only exists in the client, limitations of http or servers are not relevant.
I made a simple jsfiddle to test this: http://jsfiddle.net/Jz3ZA/. In both Chrome and Firefox (Ubuntu 12.04) hashes up to 50K seem to work. Does this mean I could use them to store state or am I overlooking other limitations?