Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Answers

Compression - honoring "q" weight values in Accept-Encoding header

Hi all, it seems F5 ignores the "q" weight values inside an "Accept-Encoding:" header used for compression. The syntax is described in RFC2616 I am using version 12.1.3, http compression profile enabled, using curl to test. F5 seems to only look for gzip, deflate or * strings.

Example - deflate should be used as it has higher priority but F5 chooses gzip:

C:\Users\D071955>curl -i --header "Accept-Encoding: gzip;q=1.0, deflate;q=2.0" 192.168.110.50
HTTP/1.1 200 OK
Server: nginx/1.7.2
Date: Thu, 06 Sep 2018 11:00:04 GMT
Content-Type: text/html
Content-Length: 417
Last-Modified: Fri, 06 Jan 2017 17:00:30 GMT
Connection: keep-alive
ETag: "586fcd2e-2a8"
Accept-Ranges: bytes
Vary: Accept-Encoding
Content-Encoding: gzip

Example 2 - no compression should be used, F5 still uses gzip:

C:\Users\D071955>curl -i --header "Accept-Encoding: *;q=0" 192.168.110.50
HTTP/1.1 200 OK
Server: nginx/1.7.2
Date: Thu, 06 Sep 2018 11:05:50 GMT
Content-Type: text/html
Content-Length: 417
Last-Modified: Fri, 06 Jan 2017 17:00:30 GMT
Connection: keep-alive
ETag: "586fcd2e-2a8"
Accept-Ranges: bytes
Vary: Accept-Encoding
Content-Encoding: gzip

Can anyone confirm that this is expected behavior?

0
Rate this Question
Comments on this Question
Comment made 3 months ago by What Lies Beneath 6688

The maximum quality value is 1, which makes your first request invalid and likely the default value of 1 is used instead, allowing the F5 to choose what's used:

deflate;q=2.0"
0
Comment made 3 months ago by Michal Kratochvil 109

Thanks for the comment, I didn't know 1 is maximum. Nevertheless, I have tested it with values lower than 1 with the same results..

curl -i --header "Accept-Encoding: deflate;q=1.0, gzip;q=0.5" 192.168.110.50
HTTP/1.1 200 OK
Server: nginx/1.7.2
Date: Thu, 06 Sep 2018 13:30:32 GMT
Content-Type: text/html
Content-Length: 417
Last-Modified: Fri, 06 Jan 2017 17:00:30 GMT
Connection: keep-alive
ETag: "586fcd2e-2a8"
Accept-Ranges: bytes
Vary: Accept-Encoding
Content-Encoding: gzip
0
Comment made 3 months ago by What Lies Beneath 6688

Interesting. Perhaps the F5 simply ignores the q values. Have you tried changing the compression setting to deflate on the F5 (and reversing the q values) to see if that changes what's used? If so, you can confidently assume the F5 is ignoring q values.

Regarding your second request, I think *;q=0 effectively means you will only accept an encoded version (which may or may not be compressed). I think to disable compression you would need identity;q=1 *;q=o for disable compression. Of course, if the F5 is ignoring q values a value of identity alone may be your only option.

0
Comment made 3 months ago by Michal Kratochvil 109

I swapped the gzip/deflate on the F5 and the q values in the test and outcome is the same so I take it as confirmed that F5 ignores the q values..

Thanks for your suggestions!

0
Comment made 3 months ago by What Lies Beneath 6688

Great (I suppose). You're welcome.

0

Answers to this Question