trafficserver icon indicating copy to clipboard operation
trafficserver copied to clipboard

Add stale-if-error, max-stale CC directive capability

Open mlibbey opened this issue 7 months ago • 2 comments

In https://github.com/apache/trafficserver/pull/12241 we fix some our serving stale if error cases. The existing logic seems like it would be straightforward to support 2 CC directives: max-stale: https://www.rfc-editor.org/rfc/rfc9111#name-max-stale stale-if-error: https://datatracker.ietf.org/doc/html/rfc5861#section-4

eg, if both max-stale and stale-if-error directives exist then test if the object age <= max-age + max of (max-stale, stale-if-error) else if max-stale directive exists, then test if the object age <= max-age + max-stale else if stale-if-error directive exists, then test if the object age <= max-age + stale-if-error else if neither directive, test (the above PR logic) age <= max-age + records.config's proxy.config.http.cache.max_stale_age

mlibbey avatar May 21 '25 16:05 mlibbey

For the stale-if-error, Stale Response Plugin covers what we want here? or we need to add support in ATS core? https://docs.trafficserver.apache.org/en/10.0.x/admin-guide/plugins/stale_response.en.html

masaori335 avatar Jul 30 '25 00:07 masaori335

For the max-stale, it looks like ATS core has support. This logic is not working as expected? https://github.com/apache/trafficserver/blob/347a5a33e35353be073984f67a29159038e991f4/src/proxy/http/HttpTransact.cc#L7356-L7387

masaori335 avatar Jul 30 '25 00:07 masaori335