| ▲ | bgilroy26 4 days ago | ||||||||||||||||
To save the url length, why not hash all possible states and have the value of the variable in the query string refer to that? | |||||||||||||||||
| ▲ | poncho_romero 4 days ago | parent | next [-] | ||||||||||||||||
This is a viable solution, but as the article mentions, you lose intent and readability (e.g. seeing a query parameter for “product=laptop” vs. “state=XBE4eHgU”). And in general, it’s unlikely you’ll run into issues with URL length. Two to eight thousand characters is a lot! | |||||||||||||||||
| |||||||||||||||||
| ▲ | linked_list 4 days ago | parent | prev | next [-] | ||||||||||||||||
Because a hash is by definition a one-way mapping, so then you'd have to keep a map of the reverse mapping hash -> state, which obviously gets impractical with state such as page index or search terms. Better just make two-way "compression" mapping | |||||||||||||||||
| |||||||||||||||||
| ▲ | cyptus 4 days ago | parent | prev [-] | ||||||||||||||||
and where is the hash mapped back again? | |||||||||||||||||