Skip to content

Actions/filters to purge cache by cache-tags #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

Closed
remcotolsma opened this issue May 23, 2025 · 2 comments · Fixed by #9
Closed

Actions/filters to purge cache by cache-tags #6

remcotolsma opened this issue May 23, 2025 · 2 comments · Fixed by #9
Assignees
Labels
enhancement New feature or request

Comments

@remcotolsma
Copy link
Member

List by ChatGPT, need to check what this plugin and https://wordpress.org/plugins/cloudflare/ does by default?

  • save_post
  • delete_post
  • trashed_post
  • untrashed_post
  • created_term
  • edited_term
  • delete_term
  • profile_update
  • deleted_user
@rvdsteege
Copy link
Member

From https://wordpress.org/plugins/cloudflare/

$cloudflarePurgeEverythingActions = array(
    'autoptimize_action_cachepurged',   // Compat with https://wordpress.org/plugins/autoptimize
    'switch_theme',                     // Switch theme
    'customize_save_after'              // Edit theme
);

$cloudflarePurgeURLActions = array(
    'deleted_post',                     // Delete a post
    'delete_attachment',                // Delete an attachment - includes re-uploading
);

add_action('transition_post_status', array($cloudflareHooks, 'purgeCacheOnPostStatusChange'), PHP_INT_MAX, 3);

add_action('transition_comment_status', array($cloudflareHooks, 'purgeCacheOnCommentStatusChange'), PHP_INT_MAX, 3);
add_action('comment_post', array($cloudflareHooks, 'purgeCacheOnNewComment'), PHP_INT_MAX, 3);

Should we also hook the $cloudflarePurgeEverythingActions actions and support purge everything? Currently, we only support this through CLI.

@remcotolsma
Copy link
Member Author

Should we also hook the $cloudflarePurgeEverythingActions actions and support purge everything? Currently, we only support this through CLI.

Sounds like a good plan to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants