Forum Discussion
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?
- What_Lies_Bene1
Cirrostratus
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"
- mkratochvil
Cirrus
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
- What_Lies_Bene1
Cirrostratus
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
effectively means you will only accept an encoded version (which may or may not be compressed). I think to disable compression you would need*;q=0
for disable compression. Of course, if the F5 is ignoring q values a value ofidentity;q=1 *;q=o
alone may be your only option.identity
- mkratochvil
Cirrus
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!
- What_Lies_Bene1
Cirrostratus
Great (I suppose). You're welcome.
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com