News for hackers. Stuff that matters.
Re:How to store your app's entire state in the url by voidmain0001 on Monday January 09, 2023 @03:45PM (#34315769)
Pass that super duper long Yahoo URL to Tinyurl and shrink it down to https://tinyurl.com/bdfepwar

It seems like storing state in the URL could benefit from URL shortening techniques so long as the secret sauce logic is both client and server side.

Re:How to store your app's entire state in the url by stnmtn on Monday January 09, 2023 @03:47PM (#34315791)
This loses all the benefits of storing all state in the url, which is that it's inspectable by the client. Using a URL shortener still makes all the data stored somewhere in the server
Re:How to store your app's entire state in the url by voidmain0001 on Monday January 09, 2023 @05:56PM (#34317713)
Okay that's not exactly what I had in mind. My suggestion was to implement the same hash both server and client side so that the query string is small and manageable. Don't worry about the state not being fully legible because you will implement the hash decode on the client too. The code will be there for you to peruse.
Re:How to store your app's entire state in the url by vikramkr on Monday January 09, 2023 @07:27PM (#34318571)
How would you decode the hash? Amy of infinite states could map to the hash
Re:How to store your app's entire state in the url by voidmain0001 on Monday January 09, 2023 @08:24PM (#34319062)
I've lost my mind. I literally just implemented a dictionary web API the other week and have completely forgotten how I did it. Just forget what I wrote.
Re:How to store your app's entire state in the url by lsaferite on Tuesday January 10, 2023 @12:26PM (#34328278)
The primary benefit of storing all the state in the URL is that the server can be stateless. Using a shortener just moves the state to a different server. A user being able to inspect the state is just a side benefit.