]> git.kaiwu.me - haproxy.git/commit
BUG/MINOR: cache: do not refuse to store responses with "Age: 0"
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 21 Oct 2026 08:35:47 +0000 (08:35 +0000)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 12 Nov 2026 17:20:31 +0000 (18:20 +0100)
commit26b254c14b3c14f76bcfcd8984bfee6efcf08778
treede9aea972b42da9751bb7e02854bca7ddc09eea4
parent4930d112a2a20120f053af0cdc106d13b3c07bc3
BUG/MINOR: cache: do not refuse to store responses with "Age: 0"

Responses carrying an "Age: 0" header are never stored in the cache. This
header is commonly emitted by an upstream cache or CDN delivering an object
it just fetched, so in a setup chaining caches, the haproxy cache simply
never stores these objects and all requests for them reach the servers,
which only affects performance and the load of the servers.

The Age value is parsed with strl2llrc() and only accepted when strictly
positive, any other case jumping to the "out" label as an invalid value.
Zero is a perfectly valid Age value (RFC 9111#5.1), it is not stale and
needs no special treatment, so it is now accepted like positive values.
Negative or non-numerical values are still considered invalid.

This patch may be backported to all supported versions.
src/cache.c