Revalidate purged static cache URLs#188
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a cancelable pre-purge event and extends static cache purging to optionally include public element URLs (fetchUrls) so the gateway can re-fetch and repopulate the static cache after purges.
Changes:
- Introduces
StaticCache::EVENT_BEFORE_PURGEwith a newPurgeEvent(cancelable + mutable tags + optional element context). - Collects/deduplicates eligible public element URLs and includes them as
fetchUrlsin gateway tag purge requests (and avoids response-header purges when URL fetch is needed). - Updates unit tests and README documentation to cover event configuration and
fetchUrlsbehavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/StaticCacheTest.php | Adds coverage for the new before-purge event and fetchUrls gateway payload behavior. |
| src/StaticCache.php | Implements before-purge event, URL collection/deduping, and gateway payload support for fetchUrls. |
| src/Module.php | Refactors config caching field name ($_config → $config). |
| src/events/PurgeEvent.php | Adds new cancelable purge event type carrying tags and element context. |
| README.md | Documents configuring the new purge event via Yii DI and explains fetchUrls behavior. |
💡 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: 1d4e99c3f7
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0f543ef224
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1cfd4f8186
ℹ️ 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".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 24e3bfdef8
ℹ️ 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".
Summary
fetchUrlspurge payload so the gateway can asynchronously repopulate purged pagespurgeOrigin()canonical while retainingpurgeGateway()as a deprecated aliasfetchUrlsbehaviorTesting
composer test(78 tests, 226 assertions, 1 existing Craft 4 skip)composer phpstancomposer cs:checkcomposer validate --no-check-publishgit diff --check