The task is as follows: Store all selected filters, sorting and search as a part of url. E.g.
?searchStr=someSearch&sortBy=date.asc...
Reason for this:
- copy pasting such url is convenient because user can go to it and have the same filters already selected
- on page refresh the state of filters won't be lost
issue I found that max length of url is about 2000 characters. User in the app may (potentially) select a lot of filters(some of them are multiselects), meaning url length may become quite lengthy.
Are there some known practices about how to solve this issue?
I can think only about two possible solutions:
- If select an option, store only it's id (without label, etc.)
- make filter group key name as short as possible. E.g. instead of
?searchStr=someSearch&sortBy=date.asc...
make it
?sS=someSearch&sBy=date.asc...
It would probably add a lot of complication and overhead (because need to then convert shortended keys into normal ones)
Any suggestions and help is much appreciated