Skip to content

cache.config -> cache.yaml - #13456

Open
bneradt wants to merge 1 commit into
apache:masterfrom
bneradt:cache-yaml-first-match
Open

cache.config -> cache.yaml#13456
bneradt wants to merge 1 commit into
apache:masterfrom
bneradt:cache-yaml-first-match

Conversation

@bneradt

@bneradt bneradt commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

cache.config needs to move to cache.yaml, with a supported migration
path for existing deployments. cache.yaml becomes the default format,
while cache.config remains available when explicitly selected.

This adds a shared cache parser and marshaller used by traffic_server
and traffic_ctl. The new traffic_ctl config convert cache command
converts legacy files to cache.yaml or writes the result to stdout.

This also addresses #7701 by giving cache.yaml ordered, first-match
semantics, so broader rules no longer compound actions after a specific
match. The legacy cache.config parser retains its additive behavior.

Fixes: #7701

Copilot AI review requested due to automatic review settings July 30, 2026 01:39
@bneradt bneradt added this to the 11.0.0 milestone Jul 30, 2026
@bneradt bneradt self-assigned this Jul 30, 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.

@bneradt
bneradt marked this pull request as draft July 30, 2026 02:00
@bneradt
bneradt force-pushed the cache-yaml-first-match branch from 08ede5a to cc239f8 Compare July 30, 2026 02:25
@bneradt
bneradt marked this pull request as ready for review July 30, 2026 02:26
Copilot AI review requested due to automatic review settings July 30, 2026 02:26

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.

cache.config needs to move to cache.yaml, with a supported migration
path for existing deployments. cache.yaml becomes the default format,
while cache.config remains available when explicitly selected.

This adds a shared cache parser and marshaller used by traffic_server
and traffic_ctl. The new `traffic_ctl config convert cache` command
converts legacy files to cache.yaml or writes the result to stdout.

This also addresses apache#7701 by giving cache.yaml ordered, first-match
semantics, so broader rules no longer compound actions after a specific
match. The legacy cache.config parser retains its additive behavior.

Fixes: apache#7701
@bneradt bneradt changed the title Add first-match cache.yaml rules cache.config -> cache.yaml Jul 30, 2026
@bneradt
bneradt force-pushed the cache-yaml-first-match branch from cc239f8 to ce8a0e7 Compare July 30, 2026 03:03
@maskit
maskit requested a review from Copilot July 30, 2026 17:55

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.

Pull request overview

Copilot reviewed 42 out of 42 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (3)

doc/developer-guide/cache-architecture/architecture.en.rst:481

  • This statement is too absolute: cache pinning is driven by the cache rule configuration selected by proxy.config.cache.control.filename. During migration, pinning can still be configured via legacy cache.config when explicitly selected, so the docs should not imply cache.yaml is the only option.
Objects can only be pinned via :file:`cache.yaml` and while
:ts:cv:`proxy.config.cache.permit.pinning` is set to non-zero (it is zero by

doc/developer-guide/cache-architecture/architecture.en.rst:105

  • The sentence mixes plural subject with singular verb ("are derived" ... "is recomputed") and it reads as if only cache.yaml can drive cache layout. ATS can still be configured to use legacy cache.config via proxy.config.cache.control.filename, so this paragraph should refer to the cache rule configuration generally and fix the grammar.

This issue also appears on line 480 of the same file.

The layout and structure of the cache spans, the cache volumes, and the cache
stripes that compose them are derived entirely from :file:`storage.yaml` and
:file:`cache.yaml` and is recomputed from scratch when the
:program:`traffic_server` is started. Therefore, any change to those files can
(and almost always will) invalidate the existing cache in its entirety.

doc/developer-guide/cache-architecture/data-structures.en.rst:101

  • CacheControlResult is used for both cache.yaml rules and legacy cache.config entries (depending on proxy.config.cache.control.filename). The description should avoid implying it only applies to cache.yaml.
   Holds the actions and match state from a rule in :file:`cache.yaml`.

@cmcfarlen
cmcfarlen self-requested a review August 3, 2026 22:50
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.

When rewriting cache.config in YAML, make it not additive.

2 participants