website design · lesson 4 of 9 · sources checked 2026-11-20
edge networks and cdns
This lesson shows what an edge network does, how to separate a CDN marker from a bot-management marker, and how to read the settled status.
status of this lesson: documented in my test systempurpose
An edge network can stand in front of the origin of a site. Then each response of the site has markers of the edge, and most of them do not show a block. The first status of a page load is also not always its result.
objectives
- List the four tasks of an edge network.
- Separate a CDN marker, an ambient marker, and a definitive marker on a response.
- Explain why a page load through a managed challenge can end with the status 200.
- Record the settled status of a page load.
new terms
- edge network
- A set of servers in front of the origin that end the client connections, cache content, and can run bot checks.
- origin
- The server that holds the real content of a site, behind any edge network.
- CDN (content delivery network)
- An edge network whose main task is to cache and deliver content near the visitor.
- ambient marker
- A vendor script or cookie that is present on a page with real content and does not show a block.
- definitive marker
- A string, header, or status that proves that the site served a challenge or a block.
- challenge
- A test that a site puts in front of a visitor before it serves the content.
- clearance cookie
- A cookie that a passed challenge sets, which the site checks again on later requests.
- CAPTCHA
- A challenge that a human can pass and a program cannot pass easily.
- interstitial
- A page that a site shows before the real content, for example a challenge or a device check.
- settled status
- The HTTP status of the last main-frame document after all challenge redirects.
- fingerprint
- A set of values that a site collects from a client to identify or classify it.
- served challenge
- A challenge that the site actually showed, proved by a hard status, an interstitial marker, or no real content.
how it works
An edge network does four tasks for a site:
- It ends the TLS connection of the client.
- It keeps copies of responses in its cache, and it serves them again.
- It sends each other request to the correct origin.
- It can run a bot product, which gives a verdict on each request.
A CDN (content delivery network) is an edge network whose main task is the cache. The first three tasks occur on each request. The bot product is optional.
markers of the cache
The cache adds headers to a response. RFC 9111 defines the Age header: the estimate of the sender of the time since the response was made RFC Editor, source 1. RFC 9110 defines the Via header, which gives the protocol information of each forwarding step RFC Editor, source 2.
example A response has the status 200, the header Age: 120, and a Via header. These headers show that an edge cache served the page. They do not show a verdict.
three classes of marker
A response can carry three classes of marker:
| class | example | what it shows |
|---|---|---|
| CDN marker | A cache header, for example Age or Via | An edge served the response. It is on each response. |
| ambient marker | A vendor script or a vendor cookie on each protected page | The site uses a bot product. It does not show a block. |
| definitive marker | A challenge page or a mitigation header | The site served a challenge or a block. |
A clearance cookie shows that a bot product is active, and that the client passed a challenge before. It carries a verdict of pass, not a block.
A response is a block when it has a definitive marker, a hard status, or a failed content check. A hard status is the status 403, 429, or 503. A failed content check means that the page has no real data, for example no real title or price.
claim of a company Cloudflare states that a challenge page response has the header cf-mitigated with the value challenge Cloudflare, source 3. A page script can read this header on a fetch or XHR call.
claim of a company Amazon Web Services states that the Block action of its WAF gives the status 403 by default Amazon Web Services, source 4. With an invalid or expired token, its CAPTCHA and Challenge actions block the request and send a JavaScript interstitial. With a valid token, the request goes on to the next rule.
the managed challenge and the settled status
A managed challenge first gives the status 403 or 503 with a challenge page. A browser runs the challenge script. When the script passes, the browser makes a new navigation to the page, and the page comes with the status 200.
Thus the first status of the load is not the result of the load. The settled status is the status of the last main-frame document. The benchmark platform, my test system, records the settled status, not the first status.
example A page load gets 403 and a challenge page, then 200 and the real page. The first status gives a block. The settled status gives 200, and the real content is present.
A 503 can also come from a real outage. RFC 9110 states that a 503 response can carry the Retry-After header, which gives the expected time of the outage RFC Editor, source 2. Thus the operator examines the body of the page and the markers, not only the status.
the cache across requests
A real browser keeps assets in its own cache. It fetches a style sheet or an image one time, and then it uses its copy.
example A client sends a browser fingerprint on 50 page loads. It never fetches a style sheet, a script, or an image. A defender can compare the requests and see that the client is not a real browser.
This is a signal across requests. No single request shows it.
the two sides
| automation side | detection side |
|---|---|
| The operator must not read a CDN marker as a block. A classifier that does this hides real successes. The settled status is the status of the last main-frame document. | A CDN marker is on each response and carries no verdict. A served challenge, a mitigation header, or a clearance cookie carries the verdict. A browser fingerprint that never fetches cacheable assets is an anomaly across requests. |
design decisions
| option | gain | cost | when it is correct |
|---|---|---|---|
| Record a block from the first status | Simple. It does not use a browser. | A managed challenge that passes shows as a block. | Never as the only rule |
| Record the settled status | It gives the result of the full load. | The tool must follow each navigation of the page. | Each page load with a browser |
| Record a block on each vendor marker | It finds each protected page. | Each page behind one vendor fails, also with real content. | Never. A vendor marker is an ambient marker. |
| Record a block on a definitive marker, a hard status, or a failed content check | It separates a block from a protected page with real content. | A real outage can look like a block. | The default rule. Check a 503 for an outage. |
diagram
A table of five markers and checks on a response, with an example, what each one proves, and if it records a block alone. A CDN marker and an ambient marker do not. A definitive marker, a hard status of the settled document, and a failed content check do.
| marker or check on the response | example | what it proves | block alone |
|---|---|---|---|
| CDN marker | Age header or other cache header | An edge served the response | no |
| Ambient marker | Vendor script or cookie | The site uses the vendor | no |
| Definitive marker | Challenge page or mitigation header | The site served a challenge | yes |
| Hard status of the settled document | 403, 429, or 503 | The site refused the page | yes |
| Failed content check | No real title or price | The real content did not come | yes |
status of a page load through a managed challenge
code example
The first example classifies a response by its marker classes. It records a block for a definitive marker, a hard status, or a failed content check.
example All markers and responses are synthetic, and no marker describes a real product.
Classify each response by its marker classes. Record a block for a definitive marker, a hard status, or a failed content check.
import { readFileSync } from "node:fs";
// Synthetic markers. No marker belongs to a real product.
type Resp = { status: number; headers: Record<string, string>; cookies: string[]; body: string };
const CDN_HEADERS = ["age", "via", "x-cache"];
const AMBIENT = { cookie: "vendor_bm=", script: "vendor-sensor.js" };
const DEFINITIVE = { header: ["x-mitigated", "challenge"], body: "challenge-shell" };
const HARD_STATUS = [403, 429, 503];
function markers(r: Resp): string[] {
const found: string[] = [];
if (CDN_HEADERS.some((h) => h in r.headers)) found.push("cdn");
if (r.cookies.some((c) => c.startsWith(AMBIENT.cookie)) || r.body.includes(AMBIENT.script)) found.push("ambient");
const [name, value] = DEFINITIVE.header;
if (r.headers[name] === value || r.body.includes(DEFINITIVE.body)) found.push("definitive");
return found;
}
function verdict(r: Resp, expected: string): string {
const m = markers(r);
// A definitive marker blocks alone.
if (m.includes("definitive")) return "block: definitive marker";
if (HARD_STATUS.includes(r.status)) return "block: hard status";
if (!r.body.includes(expected)) return "block: content check failed";
// A CDN marker or an ambient marker on a page with real content is not a block.
return `no block, markers: ${m.length ? m.join(", ") : "none"}`;
}
// Argument 1: a JSON file { "name": { status, headers, cookies, body } }. Header names are in lower case.
// Argument 2: a text that each real page of the target holds.
const responses: Record<string, Resp> = JSON.parse(readFileSync(process.argv[2], "utf8"));
const expected = process.argv[3];
for (const [name, r] of Object.entries(responses)) {
console.log(`${name}: ${verdict(r, expected)}`);
}output
One line for each response: the block reason, or no block with its marker classes.
r1: no block, markers: cdn
r2: no block, markers: cdn, ambient
r3: block: definitive marker
r4: block: hard status
r5: block: content check failedI ran the code with the Node runtime and the flag --experimental-strip-types, on a file of five synthetic responses and the expected text "Product list":
- Response r1 has the status 200, real content, and the headers
AgeandVia. - Response r2 has the status 200, real content, a cache header, a vendor cookie, and a vendor script.
- Response r3 has the status 403 and the synthetic mitigation header.
- Response r4 has the status 503, a
Viaheader, and no real content. - Response r5 has the status 200, a vendor cookie, and no real content.
The second example records the settled status of a page load. It reads only the main-frame documents.
example All page loads are synthetic.
Find the last main-frame document of each page load, and record its status as the settled status.
import { readFileSync } from "node:fs";
// One response of a page load, in the order of arrival. All values are synthetic.
type Event = { kind: string; frame: "main" | "sub"; status: number };
function settle(events: Event[]): string {
// Only a document of the main frame counts. A frame inside the page, a script, or a call does not.
const docs = events.filter((e) => e.kind === "document" && e.frame === "main");
if (docs.length === 0) return "no main-frame document: no settled status";
const first = docs[0].status;
const settled = docs[docs.length - 1].status;
return `first ${first}, settled ${settled}, main-frame documents ${docs.length}`;
}
// Argument 1: a JSON file { "name": [ { kind, frame, status }, ... ] }, one list for each page load.
const loads: Record<string, Event[]> = JSON.parse(readFileSync(process.argv[2], "utf8"));
for (const [name, events] of Object.entries(loads)) {
console.log(`${name}: ${settle(events)}`);
}output
One line for each page load: the first status, the settled status, and the count of main-frame documents.
load-a: first 403, settled 200, main-frame documents 2
load-b: first 503, settled 503, main-frame documents 1
load-c: first 200, settled 200, main-frame documents 1I ran the code in the same way, with three synthetic page loads:
- Load a: a document with 403, a script, a document with 200, and an XHR call.
- Load b: a document with 503 and a script.
- Load c: a document with 200, the document of an iframe with 403, and a
fetchcall with 403.
failure modes
| problem | cause | correction |
|---|---|---|
| Each page behind one CDN fails your check. | The check reads a CDN marker or an ambient marker as a block. | Record a block only for a definitive marker, a hard status, or a failed content check. |
| A page with real content shows as a block. | The check records the status of the first response, and a managed challenge passed. | Record the settled status. |
| A 403 of an iframe or of a call shows as a block of the page. | The check reads each response of the load. | Read only the main-frame documents. |
| A real outage shows as a block. | A 503 can come from an outage. | Examine the body and the markers. Read the Retry-After header. |
| Your check sees an enabled button, but the data never loads. | The check tests for a control, not for the data. | Check for real data, for example a real title or a real price. |
check questions
List the four tasks of an edge network. Say which task is optional.
sample answer
The edge ends the TLS connection of the client, keeps copies of responses in its cache, and sends each other request to the correct origin. It can also run a bot product that gives a verdict on each request. The bot product is optional.
A response has the status 200, real content, the header Age, and a vendor cookie. What is the result?
- A block, because a vendor cookie is present
- No block, because a CDN marker and an ambient marker show no block
- A block, because the header Age shows an edge
answer
b. No block, because a CDN marker and an ambient marker show no block
The header Age is a CDN marker, and the vendor cookie is an ambient marker. Neither marker shows a block. The status is 200, and the real content is present.
Explain why a page load through a managed challenge can end with the status 200.
sample answer
The first response is a challenge page with 403 or 503. A browser runs the challenge script. When the script passes, the browser makes a new navigation, and the page comes with 200. The settled status is the status of this last main-frame document.
A page load has a main-frame document with 403, a script, a main-frame document with 200, and a fetch call with 403. What is the settled status?
- 200
- 403
- No settled status
answer
a. 200
The settled status is the status of the last main-frame document, which is 200. The fetch call is not a document of the main frame.
exercise
exercise Do this task in your own lab, with synthetic data only. Do not send a request to a site.
- Save the second code example in an empty folder of your lab.
- Write a JSON file with three synthetic page loads.
- In load A, put a main-frame document with 503, a script, and a main-frame document with 200.
- In load B, put a main-frame document with 200 and a
fetchcall with 403. - In load C, put a main-frame document with 403 and an iframe document with 200.
- Run the code with Node, the flag
--experimental-strip-types, and the file. - Record the first status and the settled status of each load.
- Write which loads are a block by the settled status.
sample answer
This model answer uses the three synthetic page loads only.
Load A gives first 503 and settled 200. It is not a block, because the last main-frame document has 200. Load B gives first 200 and settled 200. The 403 of the fetch call does not change the settled status. Load C gives first 403 and settled 403. It is a block, because the iframe document does not count.
sources
- RFC 9111: HTTP Caching, RFC Editor, standard, read 2026-11-20
- RFC 9110: HTTP Semantics, `CONNECT` in section 9.3.6, RFC Editor, standard, read 2026-11-20
- Detect a Challenge Page response, Cloudflare, documentation, read 2026-11-20
- Using rule actions in AWS WAF, Amazon Web Services, documentation, read 2026-11-20
- My model of the tasks of an edge network, the marker classes, and the managed challenge, 2026-11 (not public).
- Benchmark platform, design (my test system): the rule that records the settled status, 2026-11 (not public).