Namespace cache purge tags by environment#191
Conversation
There was a problem hiding this comment.
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 andorigin:-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.
There was a problem hiding this comment.
💡 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".
ea097d5 to
4178a08
Compare
Uses environment-first URI and CDN purge tags (
{environmentId}:uri...and{environmentId}:cdn...) with the single{environmentId}:overflowfallback 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