Shaft Sort Option

I have a lot of queries that avoid caching because all of their permutations are listed, i.e.

http://.....&var=a,b,c http://.....&var=a,c,b http://.....&var=b,a,c http://.....&var=b,c,a http://.....&var=c,a,b http://.....&var=c,b,a 

Is there any reasonable way to hash these values ​​with the same value? Easiest way for sub in a sorted version of a querystring value?

+6
source share
2 answers

I wrote a module for Varnish that rewrites query parameters in alphabetical order.

Blog post with some explanation:
http://cyberroadie.wordpress.com/2012/01/05/varnish-reordering-query-string/

The code can be found here: https://github.com/cyberroadie/varnish-urlsort

+10
source

“Rewrite your URL in canonical form, and then enter“ hash. ”This is easier said then because vcl has no operations to process parameters (other than matching regular expressions). To perform processing, you will need built-in C, or use another balancer proxies / loads (if you have one) in front of your varnish to rewrite your request (for example, ngingx).

+2
source

Source: https://habr.com/ru/post/901166/


All Articles