URL Sort

This module lets you orders the query parameters of an URL. In Varnish the URL is the key to caching. If it recognises a previously requested URL it will look if it is available in its cache and deliver this back. There is a small problem with URLs which have parameters.Take a look at the following queries:

Each of them will return the same result, the parameters are the same, only the order is different. Varnish treats each of them as a different query and will, in this case, do three separate requests to the backend and cache all of them. With this module the three URLs above will all be rewritten with their parameters ordered like this: http://localhost/test?aaa=111&bbb=222&ccc=333&ddd=444 How it works:

The url get tokenised, the parameters are put in a binary tree and after that an in order traversal gets them out again. Performance of this method is on average O(n log(n)).

Used in production
Varnish version supported: 
Commercial support: 


I suspect there might be problems with this VMOD. There might be a resource leak or something.

Varnish Software