I've written a small piece of C code which can be embedded in the varnish configuration. It puts the query parameters of an URL in order, so equal URLs with their parameters in different order become the same<div>blog post explaining it: </div>
<div><a href="http://cyberroadie.wordpress.com/2012/01/05/varnish-reordering-query-string/">http://cyberroadie.wordpress.com/2012/01/05/varnish-reordering-query-string/</a></div><div><br></div><div>source code:</div><div>
<a href="https://github.com/cyberroadie/varnish-urlsort">https://github.com/cyberroadie/varnish-urlsort</a></div><div><br></div><div>I haven't used this in a large scale live environment (yet), so please be careful and test first! </div>
<div><br></div><div>Hope its useful, </div><div><br></div><div>Olivier</div>