manifest / performance / wp-graphql-cloudflare-cache
WPGraphQL Cloudflare Cache WP Registry grade A. No security issues foundWP RegistryNo security issues foundOpen the reportA
★ 0stars
v1.1.1latest · 27d ago
Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/dexerto/wp-graphql-cloudflare-cache/archive/refs/heads/main.zipNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
WordPress plugin that integrates WPGraphQL with Cloudflare's cache purge API. It adds Cache-Tag headers to GraphQL responses and automatically purges those tags via Cloudflare when content changes.
Requirements
- WordPress 5.6+
- PHP 7.4+
- WPGraphQL 1.16.0+
- WPGraphQL Smart Cache (provides the
graphql_purgeaction that triggers purges)
How it works
- Cache-Tag headers -- On every GraphQL response, the plugin copies WPGraphQL's
X-GraphQL-Keysheader into aCache-Tagheader that Cloudflare reads for tag-based caching. - Automatic purging -- When content changes in WordPress, WPGraphQL Smart Cache fires a
graphql_purgeaction with the relevant cache keys. This plugin sends those keys to Cloudflare's/purge_cacheAPI to invalidate only the affected cached responses.
Configuration
- In the WordPress admin, go to GraphQL > Settings > Cloudflare.
- Enter your Zone ID (how to find it).
- Enter a Cloudflare API Token with
Zone.Cache Purgepermission (create one here). - Check Enable Cloudflare Revalidation.
Local development
Prerequisites
Setup
composer install
npm install
npm start # starts WordPress at http://localhost:8888
npm run seed # creates sample posts, pages, categories, and tags
WP Admin: http://localhost:8888/wp-admin/ (username: admin, password: password)
GraphQL endpoint: http://localhost:8888/index.php?graphql
The environment comes with WPGraphQL, WPGraphQL Smart Cache, and this plugin pre-activated.
Available scripts
| Command | Description |
|---|---|
npm start |
Start the WordPress environment |
npm run seed |
Populate sample content (idempotent) |
npm stop |
Stop the environment |
npm run destroy |
Remove all containers and data |
composer phpcs |
Run PHP linting (WordPress/VIP coding standards) |
composer phpcbf |
Auto-fix lint issues |
Commits and PRs
- Conventional Commits enforced by a local git hook
- PRs are squash-merged to
main-- the PR title becomes the commit message
Releases
3 releases.
These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.