PHP · WORDPRESS & CLOUDFLARE KV
wp-cloudflare-kv — WordPress Object Cache & Storage Bridge for Cloudflare Workers KV
wp-cloudflare-kv is a PHP library and WordPress drop-in bridge for reading and writing globally distributed key-value pairs in Cloudflare Workers KV. Developers use it to push pre-rendered HTML fragments, feature flags, and redirect tables from WordPress to 300+ Cloudflare edge locations.
$ composer require bhubbard/wp-cloudflare-kv
Copy
GitHub ↗
Global Edge Read
< 5 ms Hot KV
Bulk Write API
Up to 10,000 Keys
TTL Expiration
Minimum 60s Precision
Metadata Support
1,024 Byte JSON
01. Interactive Workbench
02. Reference Implementation
03. Architecture & Specs
Interactive WordPress Transient -> Cloudflare KV Key, TTL & Metadata Inspector
KV Namespace Key & JSON Value
KV Storage Operation
PUT Key with `expiration_ttl=3600` & JSON Metadata
GET Value with Edge Cache Hit Telemetry
Bulk PUT (Up to 10,000 Key-Value Pairs in 1 Request)
Prefix-Filtered Key Listing (`list_keys('wp:site:1:')`)
Execute Pipeline ▶
Reset
Deterministic Execution Output & Telemetry
STATUS: READY // 0 ERRORS
PHP (WP Cloudflare KV Client)
$kv = new \BHubbard\CloudflareKV\Client(
account_id: CF_ACCOUNT_ID,
namespace_id: CF_KV_NAMESPACE_ID,
api_token: CF_API_TOKEN
);
// Store edge-cached payload with 1-hour TTL and metadata
$kv->put(
key: 'wp:site:1:homepage_hero_payload',
value: wp_json_encode( $payload ),
ttl: 3600,
metadata: [ 'updated_by' => get_current_user_id(), 'blog_id' => 1 ]
);
Production Engineering Specifications
Repository: https://github.com/bhubbard/wp-cloudflare-kv
Live Studio: https://code.brandonhubbard.com/wp-cloudflare-kv/
Portal: https://code.brandonhubbard.com/
Install: composer require bhubbard/wp-cloudflare-kv
Design System: Brandon Hubbard Swiss Modernist (#0A0A0C / 1px Exposed Structural Grid)