5 ms·
That's really interesting. Do you have any idea how much data (i.e. max amount of json) you can store using something like that?
by kishinmanglani 4y ago
That's really interesting. Do you have any idea how much data (i.e. max amount of json) you can store using something like that?
- bckygldstn 4y agoIt seems to vary greatly by browser. Based on this SO answer [1] MS edge only supported 2000 characters in 2017, while Chrome currently handles 40 million characters (of compressed, encoded json). [1] https://stackoverflow.com/a/44532746 https://stackoverflow.com/a/44532746
- G3rn0ti 4y agoWeirdly, with IEs it was exactly 2083 characters (1) not some base 2 number and MS never increased this number over all these years. This upper limit even included fragments. We tried to do something similar as described in the article and were surprised to learn about IEs limitation. In the end, we stored states on a JS object instead using their hash sum as keys and put that inside the fragment. Then fragment based navigation worked like charm across browsers. (1) https://support.microsoft.com/en-us/topic/maximum-url-length-is-2-083-characters-in-internet-explorer-174e7c8a-6666-f4e0-6fd6-908b53c12246 https://support.microsoft.com/en-us/topic/maximum-url-length...
- refulgentis 4y agoI don't quite understand and it's on me, trust me :) My reading is you were worried about length of encoding one state, so you moved to encapsulating states in a dictionary with keys of hash of State and objects of State And this led to a decrease in size of the URL? My guess at my misunderstanding: you kept the state dictionary server-side or at least some other storage method than the URL, and just used the URL to identify which state to use from the dictionary. I e. The bit you add to the URL is just the hash of the state, or dictionary key
- G3rn0ti 4y agoYes, in the final solution we just stored a hash sum inside the URL fragment (I think it was an MD5 sum) and the actual state inside a JS object in main memory. With a page reload you lost all states which was fine for us but you could use session storage to avoid that.
- TedDoesntTalk 4y ago> were surprised to learn about IEs limitation IE was all about limitations Nothing surprised me about IE limitations.