]> git.kaiwu.me - haproxy.git/commit
MINOR: cache: Register the cache as a data filter only if response is cacheable
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 6 Dec 2018 20:59:39 +0000 (21:59 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 11 Dec 2018 16:09:31 +0000 (17:09 +0100)
commit67658c9c9aa3f8e3b5c383da00018cd5220cb967
treeb73e9fb8c802e89e0e2eca874ddce70002b08e02
parent1f672c536d998d31443855489837b9cc9891dcc3
MINOR: cache: Register the cache as a data filter only if response is cacheable

Instead of calling register_data_filter() when the stream analyze starts, we now
call it when we are sure the response is cacheable. It is done in the
http_headers callback, just before the body analyzis, and only if the headers
was already been cached. And during the body analyzis, if an error occurred or
if the response is too big, we unregistered the cache immediatly.

This patch may be backported in 1.8. It is not a bug but a significant
improvement.
src/cache.c