After you turn on Sort Query Strings, Edge Security Acceleration (ESA) automatically sorts the query strings in the URLs when processing requests. Then, ESA returns the requested resources from the cache or redirects the requests to the origin server based on the sorted query strings. This way, POPs return the same file for requests that contain the same parameters and values, regardless of the order of query strings in the request URLs. This feature improves the cache hit ratio.
How it works
By default, the order of query strings, which follow the question mark (?) in the request URL, affects the caching behavior. ESA caches separate resources for requests that contain the same parameters and values if the query string order is different in the requests. This leads to fragmented cache and poor caching efficiency.
For example, you have an e-commerce website, and users can filter products by using query strings. The following sample request URLs contain the same parameters in a different order:
https://www.example.com/products?title=0&color=red&size=mediumhttps://www.example.com/products?size=medium&color=red&title=0
If you do not turn on Sort Query Strings, ESA considers that the requests are for different resources even though the requests correspond to the same resource for the origin server. In this case, you can turn on Sort Query Strings.
If you turn on Sort Query Strings, ESA considers that the requests are for the same resource. This way, the two requests can hit the same resource cached on a POP, which needs to retrieve the resource from the origin server only once. This enables the cache to be better utilized and improves the website performance and user experience while reducing loads on the origin server.
Enable sort query strings
In the ESA console, choose Websites and click the website name you want to manage.
In the left-side navigation pane, choose .
Turn on Sort Query Strings.
