3 ms·
Pass that super duper long Yahoo URL to Tinyurl and shrink it down to https://tinyurl.com/bdfepwar https://tinyurl.com/bdfepwar It seems like storing state in
by voidmain0001 4y ago
Pass that super duper long Yahoo URL to Tinyurl and shrink it down to https://tinyurl.com/bdfepwar 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.
- stnmtn 4y agoThis 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
- voidmain0001 4y agoOkay 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.
- vikramkr 4y agoHow would you decode the hash? Amy of infinite states could map to the hash
- voidmain0001 4y agoI'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.
- lsaferite 4y agoThe 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.