Cloudflare setup, page rules for admin bypass, hardened Real IP restoration, and what to expect from putting a CDN in front of a PHP site.
Why CDN for a PHP Site
A Content Delivery Network caches your static assets (CSS, JS, images) on servers worldwide, serving them from the location closest to the visitor. For a PHP CMS like jekcms, a CDN in front of your site can also cache full HTML pages at the edge, turning a slow origin response into a near-instant cache hit for repeat visitors.
Cloudflare's free plan is a common choice: CDN with global edge locations, a free SSL certificate, basic DDoS protection, and a handful of page rules. That covers what most small-to-medium CMS sites need.
DNS and SSL Setup
Point your domain's nameservers to Cloudflare. Enable "Full (Strict)" SSL mode — this ensures encryption both between the visitor and Cloudflare, and between Cloudflare and your origin server. Avoid "Flexible" SSL; it leaves the connection between Cloudflare and your server unencrypted.
Page Rules for Admin
The admin panel should never be cached. Create a page rule: example.com/admin/* → Cache Level: Bypass. This ensures admin pages always hit the origin server with fresh data. Do the same for any API routes: example.com/api/* → Cache Level: Bypass.
Real IP Restoration
When Cloudflare proxies requests, the visitor's real IP address arrives in the CF-Connecting-IP header instead of REMOTE_ADDR. jekcms resolves this in a hardened way rather than trusting the header blindly — it validates the header against Cloudflare's published IP ranges before using it, and falls back to REMOTE_ADDR otherwise (native/includes/Security.php).
This matters for anything IP-dependent — rate limiting, login-attempt tracking, analytics — because without it, every request behind Cloudflare would appear to come from Cloudflare's own edge IPs instead of the real visitor.
Cache Purging
jekcms does not ship a built-in Cloudflare cache-purge integration — there is no API token setting or one-click "purge this URL" button tied to Cloudflare specifically. When you publish or update content behind Cloudflare, purge the cache either from the Cloudflare dashboard directly or by calling Cloudflare's own purge API from your own tooling with your zone ID and API token. jekcms's own page cache (unrelated to Cloudflare) clears automatically on publish — see our cache layers guide for how that works.
What to Expect
Putting a CDN in front of a PHP site typically cuts time-to-first-byte dramatically for cached pages and offloads a large share of bandwidth from your origin server, since static assets and cached HTML are served from edge locations instead of round-tripping to PHP. The free Cloudflare plan is enough for most jekcms installations — the real limit is the number of page rules, and admin/API bypass usually only needs two.