Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sort params in url to improve browser cache hit rate #51

Closed
dominikg opened this issue Dec 12, 2023 · 0 comments · Fixed by #56
Closed

sort params in url to improve browser cache hit rate #51

dominikg opened this issue Dec 12, 2023 · 0 comments · Fixed by #56

Comments

@dominikg
Copy link
Contributor

Describe the problem

With optional parameters it is currently possible to add them at different times, and their insertion order determines their position in the query string of the url.

http caching uses the full url , so https://example.com?a=1&b=2 is a different entry than https://example.com?b=2&a=1
In order to have a more stable url representation and improve cache hit rate, it would be great if the params can be sorted.

Describe the proposed solution

use native sort() by default, add an option for custom sort function (or false to disable)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant