Skip to content

Conversation

mrrobot47
Copy link
Member

@mrrobot47 mrrobot47 commented Sep 16, 2025

Summary

  • Adds Cloudflare edge cache purging via cache tags, inspired by pantheon-systems/pantheon-advanced-page-cache.
  • Hooks into all relevant WordPress events for granular cache purging.
  • Adds admin UI and WP-CLI commands for Cloudflare cache management.
  • Ensures Cloudflare cache purging works independently of Nginx/Redis cache.

Closes: #449

This pull request introduces comprehensive support for managing Cloudflare edge cache within the plugin, including cache purging, configuration options, and WP-CLI integration. The changes add a new Cloudflare settings tab in the admin UI, implement backend logic for purging cache by tag, URL, or entirely, and provide WP-CLI commands for advanced cache management. Additionally, the plugin's metadata and dependencies are updated to reflect Cloudflare support.

Cloudflare Integration and Cache Management

  • Added a new Cloudflare_Client class to includes/class-cloudflare-client.php that wraps the Cloudflare API, providing methods to purge cache by tags, URLs, or entirely, and to manage "Cache Everything" page rules.
  • Integrated Cloudflare cache purging into the admin logic (admin/class-nginx-helper-admin.php), including support for purging all cache, purging by URL from the admin bar, and handling page rule setup and notifications. [1] [2] [3] [4] [5] [6]

Admin UI Enhancements

  • Added a new Cloudflare settings tab and options page (admin/partials/easycache-cloudflare-options.php), allowing admins to configure API tokens, zone IDs, and cache TTL, with support for saving and validating these settings. [1] [2] [3]

WP-CLI Support

  • Introduced a new WP-CLI command class (includes/class-cli.php) to purge Cloudflare cache by tag, path, or entirely, with confirmation prompts and output messages for each action.

Composer and Project Metadata Updates

  • Updated composer.json to add the Cloudflare SDK as a dependency, reflect the new Cloudflare functionality in the description and keywords, and configure Composer plugin settings. [1] [2]

Documentation

  • Added credits in the README.md for Cloudflare cache purging inspiration and architecture.

Coding Standards

  • Added an .editorconfig file to enforce consistent coding standards across editors and IDEs.

mrrobot47 and others added 4 commits September 15, 2025 16:30
- Integrate Cloudflare edge cache purging using cache tags.
- Replace Fastly logic with Cloudflare SDK and custom tag emission.
- Add admin UI, WP-CLI commands, and hooks for Cloudflare cache management.
- Credits: pantheon-systems/pantheon-advanced-page-cache for architectural inspiration.
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.

Feature Request: Cloudflare Edge Cache Purging via Cache Tags
2 participants