HTTP cache does not honor vary header
Our origin web servers are set up to serve static content with either Gzip and Brotli compression. This is working fine when requesting pages directly from these servers. The Accept-Encoding header is taken into account and the appropriate content encoding is served to the browser. This changes when we add F5 LTM with standard web acceleration profile enabled to the mix. Now, even though the browser send “Accept-Encoding: gzip, deflate” the F5 returns a cached version of Brotli encoded content. It seems the HTTP cache does not honor the “vary: Accept-Encoding” header returned by the origin web servers. This causes old browsers like IE11 to receive scripts and css that it cannot render and leaving the application useless for the customer.
According documentation and this AskF5 article https://support.f5.com/csp/article/K5157 the HTTP cache should honor “vary: Accept-Encoding”, but we are not getting the expected behavior.
We definitely do not want to give up Brotli compression as it is superior to Gzip in compression size and decompression time
Any tips on how to troubleshoot this issue?