Skip to content

Namespace cache purge tags by environment#191

Draft
timkelty wants to merge 11 commits into
3.xfrom
timkelty/cache-purge-origin-tags
Draft

Namespace cache purge tags by environment#191
timkelty wants to merge 11 commits into
3.xfrom
timkelty/cache-purge-origin-tags

Conversation

@timkelty

@timkelty timkelty commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Uses environment-first URI and CDN purge tags ({environmentId}:uri... and {environmentId}:cdn...) with the single {environmentId}:overflow fallback for overlong selectors and Craft tag-count overflow.

The package sends only these tags. Rollout legacy aliases remain a gateway concern and are documented here only as cache-entry formats.

Related: craftcms/cloud-gateway#176

Copilot AI review requested due to automatic review settings July 20, 2026 15:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates static cache purge behavior to include both legacy unnamespaced origin tags and the newer origin:{environmentId}-namespaced tags, while leaving CDN tag behavior unchanged. This keeps invalidation compatible across environments that may still rely on legacy tag formats.

Changes:

  • Update origin purging (purgeOrigin() and element URI purging) to purge both legacy and origin:-namespaced tags.
  • Add/adjust unit tests to assert the expanded set of purge tags in API payloads and header fallback behavior.
  • Update StaticCache header/tag format documentation to reflect legacy vs origin: formats.

Reviewed changes

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

File Description
src/StaticCache.php Purges legacy origin tags alongside origin:{environmentId} (and URI variants), and updates tag format docs.
tests/unit/StaticCacheTest.php Adds/updates assertions to ensure both legacy and origin: tags are included in purge flows and fallbacks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings July 20, 2026 16:36

Copilot AI left a comment

Copy link
Copy Markdown

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 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread src/StaticCache.php Outdated
Copilot AI review requested due to automatic review settings July 20, 2026 16:41

Copilot AI left a comment

Copy link
Copy Markdown

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 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread src/StaticCache.php Outdated
Copilot AI review requested due to automatic review settings July 20, 2026 16:44

Copilot AI left a comment

Copy link
Copy Markdown

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 2 out of 2 changed files in this pull request and generated 1 comment.

Comment thread src/StaticCache.php Outdated
@timkelty
timkelty marked this pull request as ready for review July 20, 2026 16:48
@timkelty
timkelty marked this pull request as draft July 20, 2026 17:17
Copilot AI review requested due to automatic review settings July 20, 2026 17:22

Copilot AI left a comment

Copy link
Copy Markdown

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 2 out of 2 changed files in this pull request and generated no new comments.

@timkelty
timkelty marked this pull request as ready for review July 20, 2026 17:25

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c784e36bf5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/StaticCache.php Outdated
@timkelty
timkelty marked this pull request as draft July 20, 2026 17:38
Copilot AI review requested due to automatic review settings July 20, 2026 17:41
@timkelty timkelty changed the title Namespace origin cache purge tags Namespace cache purge tags by environment Jul 20, 2026

Copilot AI left a comment

Copy link
Copy Markdown

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 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread tests/unit/StaticCacheTest.php

Copilot AI left a comment

Copy link
Copy Markdown

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 3 out of 3 changed files in this pull request and generated no new comments.

@timkelty
timkelty marked this pull request as ready for review July 20, 2026 17:49
@timkelty
timkelty marked this pull request as draft July 20, 2026 19:31
Copilot AI review requested due to automatic review settings July 20, 2026 19:31

Copilot AI left a comment

Copy link
Copy Markdown

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 3 out of 3 changed files in this pull request and generated no new comments.

Copilot AI review requested due to automatic review settings July 20, 2026 19:37
@timkelty
timkelty force-pushed the timkelty/cache-purge-origin-tags branch from ea097d5 to 4178a08 Compare July 20, 2026 19:38

Copilot AI left a comment

Copy link
Copy Markdown

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 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread src/fs/Fs.php
Comment thread src/StaticCache.php Outdated
Copilot AI review requested due to automatic review settings July 20, 2026 19:41

Copilot AI left a comment

Copy link
Copy Markdown

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 3 out of 3 changed files in this pull request and generated no new comments.

@timkelty
timkelty marked this pull request as ready for review July 20, 2026 19:46
@timkelty
timkelty marked this pull request as draft July 21, 2026 00:54
Copilot AI review requested due to automatic review settings July 21, 2026 00:56

Copilot AI left a comment

Copy link
Copy Markdown

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 3 out of 3 changed files in this pull request and generated no new comments.

@timkelty
timkelty marked this pull request as ready for review July 21, 2026 00:59
@timkelty
timkelty marked this pull request as draft July 21, 2026 01:10
Copilot AI review requested due to automatic review settings July 21, 2026 01:12

Copilot AI left a comment

Copy link
Copy Markdown

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 3 out of 3 changed files in this pull request and generated no new comments.

@timkelty
timkelty marked this pull request as ready for review July 21, 2026 01:16
@timkelty
timkelty marked this pull request as draft July 21, 2026 16:04
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.

2 participants