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)
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 thanhttps://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)