Cloudflare OAuth 2.0, APO & 5-Tab Edge Command Center Guide
Connect Cloudflare via 1-click OAuth 2.0 PKCE or scoped API tokens, govern all 5 Edge Command Center tabs, sync APO & Edge HTML rules, and prevent Rocket Loader conflicts.
- Connects via 1-Click Zero-Knowledge OAuth 2.0 (
PKCE S256) or a Scoped API Token (Zone:Read,Zone Settings:Edit,Cache Purge:Purge,Analytics:Read)—never asking for your Global API Key (CloudflareOAuth.php). - Provides a 5-Tab Edge Command Center inside WordPress (
Overview & Purge,Edge Caching & APO,Speed & Network,Security & AI Bots,SSL/TLS & Connection) in 100% Free Core. - Batches edge purges into 30-URL chunks (
CloudflarePurge.php+CloudflareQueueMerger.php) with automatic HTTP429 Retry-AfterAction Scheduler backoff and official Cloudflare APO ownership coexistence. - Detects and disables conflicting Cloudflare Rocket Loader & Auto Minify toggles in one click so Defer & Safe Delay JS never double-rewrites scripts.
Why Connecting Cloudflare Directly to KadiCache Transforms Global TTFB#
Even when your origin server responds in 14 ms via Early PHP Delivery, physics imposes speed-of-light latency across oceans: a shopper in Sydney or Tokyo connecting to a WordPress VPS in Frankfurt still pays 220 – 310 ms of transcontinental TCP/TLS round-trip time.
Routing your domain through Cloudflare’s 300+ global edge PoPs—and synchronizing cache invalidations, Edge HTML Cache Rules, or Automatic Platform Optimization (APO) inside KadiCache’s 5-Tab Cloudflare Edge Command Center—serves cached HTML and static assets from 15 – 35 ms away anywhere on Earth while guaranteeing edits publish immediately.
Two Secure Ways to Connect (CloudflareOAuth.php)#
Legacy WordPress plugins used to ask for your Cloudflare Global API Key + account email—giving one WordPress database full root access to every domain in your Cloudflare account! KadiCache refuses Global API Keys by design and offers two least-privilege authentication flows:
- 1-Click Cloudflare OAuth 2.0 (
PKCE S256): Click Connect with Cloudflare, select the single domain zone you want to authorize in Cloudflare’s official consent screen, and KadiCache encrypts the resulting token at rest via Libsodium. - Scoped API Token (
wp-config.phpor Admin UI): Click Create Scoped Token Template to open Cloudflare’s token builder pre-populated with minimum permissions (Zone:Read,Zone Settings:Edit,Cache Rules:Edit,Cache Purge:Purge,Analytics:Read) restricted strictly to your single zone.
On WordPress Multisite networks (Multisite Network Guide), Super Admins can also share a network-level Cloudflare credential across subdomain or mapped-domain subsites (CloudflarePurge::usingNetworkCredentials()).
Complete Tour of All 5 Cloudflare Edge Command Center Sub-Tabs#
Sub-Tab in WP Admin -> KadiCache -> Cloudflare | Key Controls & Telemetry (CloudflareZoneControl.php) | Recommended Production Configuration |
|---|---|---|
| 1. Overview & Purge | Live 24h / 7d / 30d GraphQL requests, bandwidth & edge hit ratio (CloudflareAnalytics.php), Development Mode (3h auto-off), Apply Recommended Preset, and targeted URL / Full Zone Purge | Use Apply Recommended Preset on day one; reserve Purge Entire Cloudflare Zone for major theme redesigns |
| 2. Edge Caching & APO | Free Edge HTML Cache Rule (CloudflareEdgeRules.php), Cloudflare APO toggle + Cache by Device Type, Browser Cache TTL (Respect Existing Headers), and s-maxage edge TTL | Enable Respect Existing Headers + either Edge HTML Cache Rule (Free Cloudflare plans!) or APO (if subscribed) while bypassing wp-*, /cart/, /checkout/, and WooCommerce cookies |
| 3. Speed & Network | Brotli compression, Early Hints (HTTP 103), Speed Brain speculative prefetch, HTTP/3 (QUIC), 0-RTT, and Rocket Loader conflict guard | Turn ON Brotli, Early Hints, HTTP/3, and Speed Brain; keep Rocket Loader OFF! |
| 4. Security & AI Bots | WordPress WAF Shield Rule, AI Bots Protection (ai_bots_protection), Bot Fight Mode, Browser Integrity Check, and Security Level | Enable WordPress WAF Shield to block /xmlrpc.php & /wp-login.php brute-force floods at the edge before PHP runs |
| 5. SSL/TLS & Connection | SSL mode check (Full (Strict) recommended), Always Use HTTPS, Minimum TLS 1.2, TLS 1.3, and OAuth / Token disconnect | Always run Full (Strict) with a valid origin TLS certificate to avoid redirect loops |
Batched 30-URL Purges, 429 Retry-After Queue & Official APO Coexistence#
Cloudflare’s REST v4 Purge-by-URL API enforces strict per-call URL limits (30 URLs per request) and rate quotas. CloudflarePurge.php and CloudflareQueueMerger.php handle edge invalidation cleanly:
- Automatic Deduplication & 30-URL Chunking: Updating a WooCommerce product purges the product URL, its parent categories, shop archive, and linked translations in deduplicated
30-URLbatches (cloudflare_purge_httpoptionally purgeshttp://alongsidehttps://). - Resilient
429 Retry-AfterBackoff: If bulk imports trigger Cloudflare rate limiting, remaining URLs spill cleanly into an Action Scheduler retry queue honoring Cloudflare’s exactRetry-Afterheader—zero lost invalidations and zero stalled admin saves! - Official Cloudflare APO Plugin Coexistence: When the official Cloudflare WordPress plugin is active with APO auto-purge enabled, KadiCache detects it automatically—preventing duplicate purge loops while still forwarding explicit KadiCache API/CLI purges.
Why Cloudflare Rocket Loader Must Stay OFF#
Cloudflare’s legacy Rocket Loader rewrites <script> tags at the CDN edge into asynchronous type="text/rocketscript" blobs without knowing WordPress script handle dependencies (jQuery, wp-i18n, Elementor, or WooCommerce checkout). Running Rocket Loader alongside KadiCache’s Defer or Delay JavaScript double-wraps scripts and breaks mobile menus! KadiCache flags an active Rocket Loader toggle immediately inside Speed & Network (and Tools) so you can turn it OFF in one click.
Frequently Asked Operational Questions
Can I use the Free Edge HTML Cache Rule on a $0/month Free Cloudflare account?
Does KadiCache require my Cloudflare Global API Key?
Should I enable Cloudflare Auto Minify alongside KadiCache CSS & JS Minification?
Does purging a single URL in KadiCache wipe my entire Cloudflare zone cache?
Can subsite admins on WordPress Multisite accidentally purge the entire shared Cloudflare zone?
Creator of KadiCache’s Early PHP Drop-In, 7-Driver Object Cache Engine, Cloud Remove Unused CSS, and Zero-CLS Lazy Render pipeline.