News for hackers. Stuff that matters.
Re:How to store your app's entire state in the url by mikepurvis on Monday January 09, 2023 @02:55PM (#34315126)
Once you've already given up on human-readability, it probably doesn't much matter how long/gross the result is. Rather than spending effort and adding complexity, just provide a built in URL shortener.
Re:How to store your app's entire state in the url by hot_gril on Monday January 09, 2023 @03:13PM (#34315327)
I agree, same reason people use json in the first place despite the inefficiency, it's easier.
Re:How to store your app's entire state in the url by wtetzner on Monday January 09, 2023 @07:51PM (#34318794)
Well, there are limits to the lengths of URLs in much of the internet’s infrastructure, so better compression could still be useful.
Re:How to store your app's entire state in the url by jsvaughan on Tuesday January 10, 2023 @05:35AM (#34322836)
This is the critical point to make. Paste a few long texts into the boxes and the url goes into the hundreds of thousands of characters long, whereas this says that anything more than about 2000 chars puts you into uncertain territory:

https://stackoverflow.com/questions/417142/what-is-the-maxim...

Re:How to store your app's entire state in the url by p1necone on Monday January 09, 2023 @08:57PM (#34319343)
Isn't storing state in urls and then using a url shortener just a key/value store with extra steps?
Re:How to store your app's entire state in the url by taneq on Tuesday January 10, 2023 @02:36AM (#34321671)
But with added session id energy too!
Re:How to store your app's entire state in the url by mikepurvis on Tuesday January 10, 2023 @11:10AM (#34327035)
True, though I think the differences around shareability matter— a mapping-table entry is immutable, whereas even a non-logged-in session token is probably not.