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.
Overview
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 a query string. The following sample request URLs contain the same parameters in a different order:
https://www.example.com/products?title=0&color=red&size=medium
https://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.ESA This enables the cache to be better utilized and improves the website performance and user experience while reducing loads on the origin server.
Procedure
Log on to the ESA console.
In the left-side navigation pane, click Websites.
On the Websites page, find the website that you want to manage, and click the website name or View Details in the Actions column.
In the left-side navigation tree, choose
.Turn on Sort Query Strings.