Skip to main content
A caching proxy server treats each URL as a distinct file based on the path and query parameters. However, query parameters can often appear in different orders while producing the same output. For example, these two URLs return the exact same dynamically generated image:
image.jpg?width=300&height=200
image.jpg?height=200&width=300
Without Query String Sort, both URLs are cached separately, wasting storage and reducing your cache HIT rate.

How it works

Query String Sort automatically rearranges query parameters alphabetically when constructing the cache key. This means:
  • Both URLs above resolve to the same cached file
  • The cached file can be found regardless of parameter order
  • You avoid duplicate cache entries for identical content

Enable Query String Sort

1

Open your Pull Zone settings

Go to CDN > Pull Zones and select your zone.
2

Navigate to Caching settings

Click Caching in the left menu.
3

Enable Query String Sort

Check the Query String Sort option and save.

When to use it

Enable Query String Sort when:
  • Your application generates URLs with query parameters in varying orders
  • You use dynamic image transformations (width, height, quality, etc.)
  • You want to maximize cache efficiency for parameterized requests
This feature only affects how the cache key is constructed. The actual URL sent to your origin remains unchanged.