]> git.kaiwu.me - haproxy.git/commit
REGTESTS: proxy: test the "option checkcache" response filter
authorWilly Tarreau <w@1wt.eu>
Mon, 21 Sep 2026 20:44:52 +0000 (20:44 +0000)
committerWilly Tarreau <w@1wt.eu>
Wed, 30 Sep 2026 14:55:57 +0000 (16:55 +0200)
commit5d054a9236ace792b3fbceffffc7e33f29c68f1e
treee477ffeb130b61314ad8be34603fb26e75fb32ea
parente79a2f9b22e381a511330ba65efbe78403741185
REGTESTS: proxy: test the "option checkcache" response filter

"option checkcache" had no coverage. The test walks through the
conditions listed in the documentation: a cacheable 200 carrying a
Set-Cookie is blocked, a response made non cacheable by "cache-control:
private", "no-store", "no-cache=\"set-cookie\"" or "pragma: no-cache"
goes through, a status which is not cacheable by default goes through
unless the server declares the response public, and the response to a
POST is not filtered.

The origin is a second haproxy instance crafting one response per path,
because a blocked response makes the proxy close the server connection,
which a single vtest server session would not survive.

The test also documents one behavior which the documentation does not
mention: a response carrying neither freshness information nor a
validator is not considered cacheable.
reg-tests/proxy/checkcache.vtc [new file with mode: 0644]