OCMLABS/MODULE-CLOUDFLARE · HEALTH CHECKS

The 25 health checks that tell you whether Cloudflare is set up correctly for your Magento store

  • Magento
  • Adobe Commerce
  • Hyvä

Where to find them

System > Cloudflare > Dashboard > Health lists every check for the selected website with a status of pass, warn, fail or skip, a one-line fix and the evidence the check used. The checks run hourly from cron (at 15 minutes past the hour) and on demand with Run checks now. Where a fix is a single zone setting, an Apply this fix button changes it from the admin, which needs the OCMLabs_Cloudflare::settings_write ACL resource.

The same checks run from the command line, with --json for monitoring:

Terminal window
bin/magento ocmlabs:cloudflare:health
bin/magento ocmlabs:cloudflare:health --website=base --json

The command exits 1 when any check fails, so it can gate a deploy.

Connection

CheckWhat it looks for
API tokenThe token is valid and carries the permissions the module needs. Fix: create a new token with the permissions listed on the Installation page.
Zone matches storefrontThe configured zone’s name matches the website’s storefront hosts. Catches a Zone ID pasted from the wrong zone.

Zone settings

These are Cloudflare settings that break Magento or make caching pointless. Each one shows the current value and offers an Apply this fix button.

CheckWhat it looks for
SSL modeFull or Full (strict). Flexible makes Cloudflare talk HTTP to the origin, which loops with Magento’s secure base URL.
Rocket LoaderOff. It rewrites script loading and breaks RequireJS on Luma and Alpine.js on Hyva.
Auto MinifyOff on zones that still have it. Magento minifies its own assets, and Cloudflare’s minifier can break RequireJS modules and Alpine expressions.
Email ObfuscationOff. It rewrites addresses inside rendered HTML and injects a script into cached pages.
Always OnlineOff. It serves stale prices and stock from the Internet Archive when the origin is down.
Brotli, HTTP/2, HTTP/3 and Early HintsOn. Warns about each one that is off; none of them breaks Magento, they just make it faster.
Browser Cache TTLRespect Existing Headers. Any override replaces the module’s max-age=0 and keeps purged pages alive in visitors’ browsers.

Cache rules

CheckWhat it looks for
Storefront cache ruleA [OCMLabs] Cache storefront HTML rule exists for the website’s hosts.
Bypass rulesThe bypass rules exist and sit below the cache rule, so they override it.
X-Magento-Vary handlingThe vary cookie is handled, either by the bypass rule or by a custom cache key on an Enterprise zone. Fix: apply the recommended cache rules.
No POST cachingA rule bypasses non-GET requests.
Edge TTLThe TTL the cache rule applies matches the module’s edge TTL. Warns when a rule overrides the origin TTL.

Magento

CheckWhat it looks for
Cloudflare cache typeThe ocmlabs_cloudflare cache type is enabled under System > Cache Management. The module stores zone details, analytics and health results in it.
Edge cache enabledEnable Edge Caching of HTML is on for the website. Warns, rather than fails, because leaving it off is a valid choice.
Purge queue consumerCompares the last cache clean event with the last completed purge. Warns when tags are queued but nothing has gone out, which usually means the consumer is not running.
Storefront themeDetects Luma or Hyva for the website’s stores and notes which Cloudflare features would break it.
Multi-store edge cachingLists the website’s store views and currencies and explains that visitors outside the default context bypass the edge unless Vary Handling is Cache key on an Enterprise zone.
Real visitor IPWhether the current admin request’s REMOTE_ADDR was a Cloudflare address and CF-Connecting-IP was honoured. Only meaningful from an admin request that came through Cloudflare; skipped from the CLI. See Real Visitor IP.

Live probes

The probes fetch real storefront pages through Cloudflare and read cf-cache-status. They request a category page twice and expect the second to be a HIT, request a customer page and expect BYPASS or DYNAMIC, and send the vary cookie and expect the edge to step aside. Probe URLs come from the website’s own catalog, and a probe refuses to fetch anything that does not resolve to the configured storefront hosts.

CheckWhat it looks for
Edge caches a storefront pageA category page served through Cloudflare reports cf-cache-status: HIT on the second request.
Edge bypasses customer and checkout pagesThe login page reports BYPASS or DYNAMIC, never HIT.
Edge handles the vary cookieA request carrying X-Magento-Vary is not served from the edge cache.
Origin sends edge cache headersFetches the page directly from Storefront Origin, skipping Cloudflare, and checks that Cache-Control and Cache-Tag arrive intact. Fails when a proxy or Varnish between Magento and Cloudflare strips them. Skipped when Storefront Origin is blank. TLS certificate verification is skipped for this fetch, because origin certificates are rarely valid for the public host.
Cache-Tag header sizeSamples storefront responses and reports pages whose tag list had to be truncated to fit Cloudflare’s header limits, with the paths involved. Those pages still purge on a full purge but may miss a tag purge.

Each probe needs the page to answer with HTTP 200; a redirect or error is reported as a failed probe with the status it got.

Reading a result

Every result carries three things: the message (what was found), the fix (what to change, and where in the Cloudflare dashboard) and the evidence (the raw values the check looked at, such as the setting value or the response headers). When you open a support issue, attach bin/magento ocmlabs:cloudflare:health --json, which includes all three for every check.

See also

In this module