Skip to content

fix(worker): match only real s-maxage and max-age Cache-Control directives - #5785

Open
BetterAndBetterII wants to merge 1 commit into
Helicone:mainfrom
BetterAndBetterII:cursor/cache-settings-directive-anchor-4379
Open

fix(worker): match only real s-maxage and max-age Cache-Control directives#5785
BetterAndBetterII wants to merge 1 commit into
Helicone:mainfrom
BetterAndBetterII:cursor/cache-settings-directive-anchor-4379

Conversation

@BetterAndBetterII

Copy link
Copy Markdown

Unanchored /s-maxage= and /max-age= treated vendor extensions like x-s-maxage as the standard directive, so Cache-Control: x-s-maxage=3600, max-age=1800 became public, max-age=3600.

Match only real tokens (start or after ,; / whitespace). x-s-maxage no longer wins over max-age.

Fixes #5780

Vendor prefixes like x-s-maxage were substring-matched as s-maxage
because the Cache-Control parser had no token boundary. Anchor both
directives so only standalone tokens set the cache TTL.

@greptile-apps greptile-apps Bot 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

@vercel

vercel Bot commented Aug 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated (UTC)
helicone Skipped Skipped Aug 20, 2026 7:32am
helicone-bifrost Skipped Skipped Aug 20, 2026 7:32am
helicone-eu Skipped Skipped Aug 20, 2026 7:32am

Request Review

@vercel
vercel Bot temporarily deployed to Preview – helicone August 20, 2026 07:32 Inactive
@vercel
vercel Bot temporarily deployed to Preview – helicone-eu August 20, 2026 07:32 Inactive
@vercel
vercel Bot temporarily deployed to Preview – helicone-bifrost August 20, 2026 07:32 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cacheSettings regex matches x-s-maxage (and other vendor extensions) as s-maxage — no word boundary before directive name

2 participants