REGTESTS: cache: cover the object lifetime with a single script
The fixes about the object lifetime have no dedicated script each: the
reg-test reg-tests/cache/lifetime.vtc covers the whole lifetime
computation:
- the lifetime comes from s-maxage, max-age, Expires, or falls back to
the cache's max-age when the response has a validator (heuristic
lifetime);
- a null lifetime, written as "max-age=0", "max-age=00", a quoted
"max-age=\"0\"" or a null s-maxage, prevents the response from being
served from the cache;
- the Age received from the server reduces a relative lifetime but not
an absolute one given by Expires;
- "Age: 0" is a valid value, it does not prevent the response from being
cached;
- the Age of a copy delivered by the cache stays below the lifetime
announced by the server;
- the Age header of a stored response is still forwarded to the client
the response is delivered to, and the copies carry a single, freshly
computed Age header.
All the checks are made from the response headers, without any delay: the
X-Age-Relative header is set by an http-after-response rule on the
responses delivered from the cache whose Age reaches the max-age
announced by the server, which can only happen when the entry lifetime
was not reduced by the Age. X-Age-Count reports the number of Age headers
to check the forwarded response and the copies.
The script fails when any of the covered fixes is reverted, and it runs
in a few milliseconds.