Blog18 min read
Check if a website is down from Cloudflare's network
Build production-grade edge reachability checks on Cloudflare Workers - fetch timing, DNS pairing, cron alerts, error codes, and the Is It Down experiment.
When a site “looks down,” the truth often depends on where you measure from. Your laptop, a single VPS, and Cloudflare’s edge can all disagree. Probing from Cloudflare’s network gives a view closer to how many users reach origins through the edge - and it is straightforward to expose as a small Worker API using the platform Fetch API.
This guide covers definitions of “down,” probe design, pairing diagnostics, scheduled alerts, and the Is It Down experiment you can deploy today.
Cloudflare products in this pattern
| Product | Role | Docs |
|---|---|---|
| Workers | Timed probe API | Edge compute |
| Fetch | Outbound HTTP from the edge | Runtime API |
request.cf | Colo / network context for the probe itself | Request properties |
| Cron Triggers | Scheduled uptime checks | Triggers |
| D1 (optional) | Store check history | SQL |
| Email Workers / send_email | Alert delivery | |
| Radar (adjacent) | Broader internet health / ASN context | Radar API |
What “down” should mean
Be explicit. For APIs and status tools, a useful definition is:
- DNS resolves (optional separate check)
- TCP/TLS succeeds
- An HTTP response returns within a timeout
- Optionally: status is not
5xx
A site can return 200 with a broken app, or 503 while intentionally in maintenance. Encode the policy in your JSON so clients do not guess.
Example success payload:
{
"url": "https://example.com",
"ok": true,
"status": 200,
"latencyMs": 142
}Document redirect policy: follow or not, and max hops. Open redirects and file: schemes must be rejected by URL validation.
Edge probe architecture
Client → Worker → timed fetch(url) → JSON { ok, status, latencyMs }Worker responsibilities:
- Validate
url(http/https) with a shared helper - Time the request (performance marks or
Date.now()) - Catch network failures as structured errors (
FETCH_ERROR) - Never follow redirects into private or non-http(s) schemes
- Optionally attach probe colo from
request.cf
Do not turn this into a full uptime SaaS on day one. Ship the probe, then add schedules and storage.
Pair diagnostics instead of one mega-endpoint
When an origin fails, operators want more than a boolean. Compose focused Cloudflare-backed experiments:
| Question | Experiment | Product angle |
|---|---|---|
| Is it reachable? | Is It Down | Workers Fetch |
| What headers came back? | Response Headers | Fetch |
| Does DNS look sane? | URL DNS Lookup | DNS via Workers |
| Cron + email alerts? | Uptime Monitor Alerts | Cron Triggers + D1 + email |
| Multi-region latency? | Multi-POP Latency Map | Workers across POPs |
Wire them from a status page, chatops bot, or MCP tool. Each stays under ~60 seconds and single-purpose.
Scheduled monitoring with Cron Triggers
Cron Triggers let a Worker run on a schedule without an external scheduler:
Cron → Worker scheduled handler → probe targets → write D1 → email on failureThat is the path Uptime Monitor Alerts demonstrates. Use the one-shot Is It Down API for ad-hoc checks and agent tools; use cron when you need history and pages.
Operational cautions
- Respect robots and ToS for third-party targets; this is a diagnostic tool, not a scraper
- Rate-limit public deployments - open probes get abused as free scanners
- Timeouts beat hanging Workers; fail with
FETCH_ERROR - One colo ≠ global truth - a single Worker invocation runs in one location; sample multiple regions if you need that story
- TLS and SNI - some failures are certificate issues; pair with an SSL inspector experiment when needed
Error codes worth standardizing
| Code | Meaning |
|---|---|
INVALID_URL | Bad or missing URL |
FETCH_ERROR | Network / TLS / timeout |
UNEXPECTED_STATUS | Optional: non-2xx treated as down |
Keep codes stable so dashboards and agents can branch without scraping English messages.
Deploy and verify
- Read Workers Fetch once for semantics (redirects, cf properties)
- Deploy Is It Down
- Call it with a known-good URL and a known-bad host
- Confirm JSON error codes for invalid input
- Graduate to Uptime Monitor Alerts when you need cron + history
You get a tested reachability Worker with the same error conventions as the rest of the catalog - ready to embed in bigger monitoring flows built on Cloudflare products rather than a random VPS cron.
Production checklist
- Define “down” in writing (status codes, timeouts, redirect policy).
- Separate ad-hoc probes (Is It Down) from scheduled monitors (Uptime Monitor Alerts + Cron Triggers).
- Store history in D1 if humans need trends.
- Alert via email/webhook - avoid paging on single blips; require N failures.
- Rate-limit public probe APIs.
- Pair with DNS and header inspectors before declaring “origin broken.”
Multi-region truth
A single Worker invocation sees one colo. If you need “down globally,” sample multiple regions or accept that your probe is “down from Cloudflare’s network in colo X.” Document that limitation next to the green/red badge.
FAQ
Is this a replacement for paid uptime SaaS?
It is a building block. You own alerting, multi-region sampling, and SLAs. Many teams start here then graduate complexity only where needed.
Can I probe internal hosts?
Only if the Worker can reach them (public internet or appropriately configured tunnels/services). Private RFC1918 targets usually fail from the public edge.
Related experiments
These deployable references implement the patterns in this article. Open the docs for API details, then Deploy or clone the source.
- Is It Down? - Check if a website is reachable from Cloudflare's edge network - uptime and latency probe API for any URL
- Response Headers - Inspect HTTP response headers for any URL from Cloudflare's edge - security, cache, and CORS header debugging
- URL DNS Lookup - DNS lookup for any URL's hostname via Cloudflare DNS-over-HTTPS (1.1.1.1) - A, AAAA, MX, TXT, and more from a Worker
- Uptime Monitor Alerts - Persistent URL monitors with D1 history, cron checks, and email alerts on downtime - edge uptime monitoring starter
- Multi-PoP Latency Map - Measure fetch latency and report the Cloudflare colo that served the Worker - edge PoP latency visibility for any URL