-
Notifications
You must be signed in to change notification settings - Fork 2
Add optional Statamic static-cache invalidation integration for targeted Cloudflare purges #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Needs to be clear of how it works. Our own event handling + the new Statamic Static Cache events. We're not using both simultaneously?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct, it is either/or. I clarified this in both config comments and README under an "Event handling modes (either/or)" section. Addressed in commit
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should log if there is any mis-configuration.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Implemented debug logging for misconfiguration-related skips in the listener so misconfiguration is visible when |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,8 +47,14 @@ | |
| 'nav_tree_saved' => true, | ||
| 'global_set_saved' => true, | ||
| 'global_set_deleted' => true, | ||
| 'url_invalidated' => true, // Statamic Static Cache: UrlInvalidated event | ||
| 'static_cache_cleared' => true, // Statamic Static Cache: StaticCacheCleared event | ||
| ], | ||
|
|
||
| // When enabled, only Statamic Static Cache events are handled (UrlInvalidated/StaticCacheCleared). | ||
| // Legacy addon content events are skipped in this mode. | ||
| 'use_statamic_static_cache_invalidation' => env('CLOUDFLARE_CACHE_USE_STATAMIC_STATIC_CACHE_INVALIDATION', false), | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does enabling this disable our own event handling? In that case it should be made clear with a comment of how it works.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes — enabling |
||
|
|
||
| 'queue_purge' => env('CLOUDFLARE_CACHE_QUEUE_PURGE', false), // Dispatch purge jobs to the queue | ||
|
|
||
| /* | ||
|
|
||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we add the debug logging to show if and why something is mis-configured.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added debug logs for skipped events and mode mismatches (including disabled addon, mode mismatch, missing mapping, and disabled |
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make sure we have test covering any mis-configurations as well.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added focused listener tests for misconfiguration paths, including logging when events are skipped due to mode mismatch. Addressed in commit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update the readme to explain how our own event tracking work in conjunction with the Statamic Static Cache events. It's either or, right? Let's make that clear. Add the same comments as in the config file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated README to match config comments and clearly explain that event handling is either addon legacy events or Statamic Static Cache events (not both simultaneously). Addressed in commit
5d80754.