apache frontend: describe prefer-gzip-encoding-to-backend
-
Developer
even when client did not request compression -> No.
When a client do a request, you pass the Accept-Encoding header. For me it is:
Accept-Encoding:gzip, deflate, sdch, br
But in a lot of case the cache configuration has
Vary:Accept-Encoding
.Accept-Encoding
request header may vary a lot from a client to another but one of the common denominator isgzip
. So in order to avoid a multiplication of cache versions in CDN, ifgzip
is present in theAccept-Encoding
request header all other format are stripped from the request in order to reduce variation in Trafficserver.When this parameter is activated:
Accept-Encoding:gzip, deflate, sdch, br
is transmitted as
Accept-Encoding:gzip
And
Accept-Encoding:deflate, sdch, br
is transmitted as
Accept-Encoding:deflate, sdch, br
I'm not sure how to sum this up in the description. Maybe:
If set to true, frontend will strip all format expect from gzip from the Accept-Encoding request header if gzip is present in it. This functionality is used with the enable_cache parameter in order to reduce cache variation in CDN when Accept-Encoding is present in the Vary Response header
Please let me know if this is clear enough to be used as description.
-
Owner
Ahaha yes, my understanding was completly wrong. Thanks for that good explanation, that makes much more sense.
How about:
If set to true, frontend will rewrite Accept-Encoding request header to simply "gzip" for all variants of Accept-Encoding containing "gzip", in order to maximize cache hits for resources cached with Vary: Accept-Encoding when enable_cache is used
Hopefully people looking for more explanation will find your explanation on gitlab.
-
Developer
Excellent. It is very clear thanks.