]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MAJOR: compression/cache: Make it really works with these both filters
authorChristopher Faulet <cfaulet@haproxy.com>
Sat, 15 Dec 2018 21:32:02 +0000 (22:32 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 15 Dec 2018 22:50:07 +0000 (23:50 +0100)
commit27d93c3f942853710ac92b5fdf491dd259f5a90e
tree2e8fcf0faf269a856164a296a4a9697ca305c6ce
parent808e1b7c40550510bb6c1be72e5bc99c019c336b
BUG/MAJOR: compression/cache: Make it really works with these both filters

Caching the response with the compression enabled was totally broken. To fix the
problem, the compression must be done after caching the response. Otherwise it
needs to change the cache to store compressed and uncompressed objects for the
same ressource. So, because it is not possible for now, it is forbidden to
declare the compression filter before the cache one. To ease the configuration,
both can be implicitly declared (without "filter" keyword). The compression will
automatically be inserted after the cache.

Then, to make it works this way, the compression filter has been slighly
modified. Now, the response headers are updated after http-response rules
evaluations, instead of before. So, if the response contains a "Content-length"
header, it will be kept with the response stored in the cache. So this cached
response will be able to be served to clients not supporting the compression at
all.
doc/configuration.txt
src/cache.c
src/flt_http_comp.c