manifest / unclassified / wp-graphql-cloudflare-cache
WPGraphQL Cloudflare Cache
Extends WPGraphQL to add Cloudflare Tags to GraphQL responses and purge them when content is updated.
by humet · github.com/dexerto/wp-graphql-cloudflare-cache · website
★ 0stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/dexerto/wp-graphql-cloudflare-cache/archive/refs/heads/main.zipDeclares an update source (https://github.com/gdidentity/wp-graphql-cloudflare-cache), so updates arrive through the plugin's own updater.
From the readme
WPGraphQL Cloudflare Cache
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 graphqlpurge action that triggers purges)
How it works
1. Cache-Tag headers -- On every GraphQL response, the plugin copies WPGraphQL's X-GraphQL-Keys header into a Cache-Tag header that Cloudflare reads for tag-based caching.
2. Automatic purging -- When content changes in WordPress, WPGraphQL Smart Cache fires a graphqlpurge action with the relevant cache keys. This plugin sends those keys to Cloudflare's /purgecache API to invalidate only the affected cached responses.
Configuration
1. In the WordPress admin, go to GraphQL Settings Cloudflare.
2. Enter your Zone ID (how to find it).
3. Enter a Cloudflare API Token with Zone.Cache Purge permission (create one here).
4. Check Enable Cloudflare Revalidation.
Local development
Prerequisites
- Docker
- Node.js 18+
- Composer
Setup
WP Admin: http://localhost:8888/wp-admin/ (username: admin, password: pa
Read the full README on GitHub →
Releases
These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.