Skip to content

Add percentage limit for stale cache age - #13547

Open
bneradt wants to merge 2 commits into
apache:masterfrom
bneradt:max-stale-age-percent
Open

Add percentage limit for stale cache age#13547
bneradt wants to merge 2 commits into
apache:masterfrom
bneradt:max-stale-age-percent

Conversation

@bneradt

@bneradt bneradt commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

A fixed stale-age window can let short-lived cached responses remain
usable for many times their original freshness lifetime. This makes
serving stale content disproportionately risky for responses with a
short max-age.

This adds an optional percentage limit and applies the smaller of the
percentage-based and absolute stale-age windows. The default keeps the
existing behavior, while transaction overrides and supported scripting
interfaces can opt in per use case.

Fixes: #12252

A fixed stale-age window can let short-lived cached responses remain
usable for many times their original freshness lifetime. This makes
serving stale content disproportionately risky for responses with a
short max-age.

This adds an optional percentage limit and applies the smaller of the
percentage-based and absolute stale-age windows. The default keeps the
existing behavior, while transaction overrides and supported scripting
interfaces can opt in per use case.

Fixes: apache#12252
Copilot AI lite review requested due to automatic review settings August 13, 2026 19:54
@bneradt bneradt added this to the 11.0.0 milestone Aug 13, 2026
@bneradt bneradt self-assigned this Aug 13, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

A zero percentage can be mistaken for disabling stale responses, when
it actually leaves the absolute stale-age limit in control.

This clarifies the behavior with a concrete example using the default
seven-day absolute limit.
Copilot AI review requested due to automatic review settings August 13, 2026 20:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: Add % max_stale_age config

2 participants