Sort query strings

更新时间:
复制 MD 格式

Query string sorting makes Edge Security Acceleration (ESA) sort URL parameters before cache lookup or request forwarding. Requests with identical parameters are treated as the same resource regardless of parameter order, which improves the cache hit ratio.

How it works

By default, parameter order in a query string (the part after ?) affects caching. If two URLs share the same parameters in different order, ESA caches them as separate resources, causing fragmentation and reducing cache efficiency.

For example, these two e-commerce URLs have the same parameters in different order:

  • https://www.example.com/products?title=0&color=red&size=medium

  • https://www.example.com/products?size=medium&color=red&title=0

Without query string sorting, ESA treats these as two different resources even though both URLs return the same content from the origin server. With query string sorting enabled, ESA normalizes the parameter order and caches one copy. The ESA POP fetches the content only once, improving cache utilization and reducing origin server load.

Enable query string sorting

  1. In the ESA console, select Site Management, and then click the target site in the Website column.

  2. In the navigation pane on the left, choose Caching > Settings.

  3. Turn on the Sort Query Strings switch.

    image

Global and feature-level rules

The global setting applies to all requests for a site. To apply query string sorting to specific requests only, create a rule-based configuration with Custom Cache Key.