Every request that reaches a WordPress server competes for CPU, memory, database connections, and bandwidth. A visitor loading an image is inexpensive compared with generating a page through PHP, but repeated traffic and automated scans can still add up. Moving suitable work to Cloudflare can give the server more room to handle publishing, searches, purchases, and other requests that actually need WordPress.
The best starting point is to identify which responses are public and reusable, then move those requests outward in small, measurable steps. A CDN does not replace your WordPress installation or its backups.
-
Measure what reaches the server. Save a baseline before changing anything: origin request counts, response times, PHP and database CPU usage, available memory, and error rates. Separate successful page views from static assets, redirects, and requests for nonexistent files. A large number of expensive 404 responses can be a more useful target than an already well-cached image library.
Use comparable traffic and time windows for the after test. Record background jobs too: a scheduled backup or database task can make a successful offload look ineffective in a whole-server CPU graph.
-
Start with public images, CSS, JavaScript, and fonts. Cloudflare’s standard cache behavior already supports many static file types, while HTML is not cached by default. Check what is happening before adding another plugin or deployment system. The default cache behavior documentation explains the eligibility rules.
Use your browser’s Network panel, or make a GET request that displays response headers:
curl -sS -D - -o /dev/null https://example.com/wp-content/themes/example/style.cssInspect
CF-Cache-Status,Age, andCache-Control. Repeat the request to distinguish an initial cache miss from a reusable cached response. AHITis useful evidence for that asset and request; it does not establish the cache hit rate for the whole site.Give versioned assets an appropriate cache lifetime and change their URL when their content changes. Do not mark protected downloads public or apply long cache lifetimes to every response under
wp-content. If an asset is replaced at the same URL, account for both browser and CDN caches. -
Move predictable redirects and unwanted requests to the edge. Simple redirects between an old public domain and its replacement can often run before a request reaches the origin. Preserve the intended path and query string, and test for loops.
Security rules can also reduce work caused by automated probes. Begin with narrowly defined requests that you have verified are unwanted, such as specific nonexistent exploit filenames. Keep legitimate PHP entry points, login flows, forms, APIs, and verification files working. Broad rules that block every PHP request or every unfamiliar user agent can break a healthy site.
-
Treat full-page caching as a separate project. Public articles can benefit substantially when a cached HTML response avoids PHP and database work. Start with a small set of ordinary public pages and a short cache lifetime. Define exclusions before making those pages eligible for caching.
Exclude administration, login, previews, password-protected content, account pages, carts, checkout, and private APIs. Bypass requests carrying authorization or session state; a conservative initial policy bypasses all cookies until each cookie’s purpose is understood. Also inspect query parameters and plugin-specific behavior. Pages containing personal information, session tokens, or visitor-specific form state need special handling.
Cloudflare provides a cookie-based cache bypass example, but a sample expression is not a complete WordPress privacy policy. Review the final rule order and test authenticated and anonymous responses separately. Do not override
private,no-store, orSet-Cookiebehavior simply to increase the hit rate. -
Make updates and removals invalidate the cache. Publishing a change must refresh every affected view: the article, homepage, relevant archives, feeds, and any other cached listing. Unpublishing content or changing its visibility must also remove its public cached copies. A short expiry alone is not a reliable privacy control.
Use a maintained integration or carefully scoped automation, then test the entire lifecycle with harmless test content. Verify edits, deletion, and a change from public to private. Cloudflare documents purging individual URLs; the relevant cache keys and variants must be covered. If your integration cannot reliably purge the required content, defer HTML caching and continue improving static delivery.
-
Keep origin security and recovery intact. Use authenticated HTTPS between Cloudflare and the origin. With a suitable valid origin certificate, Full (strict) validates that connection. Check certificate readiness before changing the mode.
Keep encrypted backups of the WordPress database, uploads, themes, plugins, and configuration. Document the Cloudflare rules and how to reverse each change. Cache copies are disposable and cannot replace a tested restore. If you separately deploy public static files, retain their source and a documented update process; never upload a whole WordPress directory containing configuration, backups, or private files.
-
Test visitors, editors, and legitimate automated clients. Check public pages, login, editing, preview, search, forms, and checkout where applicable. Confirm mobile layouts, images, canonical URLs, robots directives, and sitemaps still work. Test intended search crawlers and AI clients too, without granting authorization based on a spoofable user-agent string.
Change one site or route group at a time and retain a quick rollback. Review feature availability, quotas, and pricing before adding Workers, object storage, or paid optimization products.
-
Compare origin work, then choose the next improvement. Count how many matching requests still reach the server and compare response times and PHP CPU over the same interval. Clearly label synthetic tests. A lower origin request count proves useful offloading, but it does not guarantee a proportional reduction in total server load.
If the server remains busy, inspect database queries, scheduled jobs, plugins, and unrelated applications. CDN work can reduce delivery overhead while a completely separate process remains the main CPU consumer. Let the measurements determine the next change.
A practical rollout moves from public static assets to carefully scoped redirects and request filtering, then to public HTML only after privacy exclusions and invalidation are proven. Keep each change small enough to test, document, and reverse.