Business Challenge
The last four posts worked upward through one region: #95 and #96 at layer 4, #97 and #98 at layer 7. Front Door is what sits in front of all of them, globally, and it is a different kind of component: a content delivery network that happens to do load balancing, rather than a load balancer that happens to cache.
That inversion matters, because it puts a cache in the request path by default and makes the most consequential decision — which of Microsoft's points of presence serves a user — before the request exists.
“AFD Unicast routing determines the appropriate PoP during DNS resolution. When the end user's location isn't available from the request metadata, routing is based on the location of the DNS resolver. This condition means the request might not be routed to the PoP closest to the user.”
So a user on a corporate network whose DNS resolves centrally, or anyone using a distant public resolver, can be sent to a point of presence nowhere near them — and nothing in the request path can correct it afterwards, because by then the TCP connection is already established to that PoP's unicast address.
And one piece of housekeeping, because it is the fourth in five posts: “Azure Front Door (classic) retires on March 31, 2027. Because the service is retiring, it no longer supports profile creation, new domain onboarding, or managed certificates.” Classic is functionally frozen already, sixteen months before the date.
Architecture
The pipeline, in order
| # | Stage | The part worth knowing |
|---|---|---|
| 1 | DNS resolution returns a PoP unicast IP | Chosen from the resolver's location when the user's is unknown |
| 2 | Client connects to that IP | Direct connection; the PoP is now fixed for this connection |
| 3 | Match request to a profile | By Host header; custom domains must be registered |
| 4 | TLS handshake | Your certificate, or Front Door's for *.azurefd.net |
| 5 | Evaluate WAF rules | A violation ends processing immediately |
| 6 | Match a route | Exact host, then exact path, then wildcard — or 404 |
| 7 | Evaluate rule sets | In order; can override the origin group the route chose |
| 8 | Return cached response | After the rules, so rules can change the cache key and behaviour |
| 9 | Select origin and forward | Health probes, routing method, session affinity |
Stage 7 before stage 8 is the ordering to internalise. The rules engine runs before the cache is consulted, which is why it can rewrite the cache key, change the cache duration, and even send the request to a different origin group than the route selected — “The origin group set by the rule set overrides the routing process”.
Route matching rejects; it does not fall back
Front Door “always matches to the most-specific request by evaluating the left-hand side properties: protocol, domain, and path, in that order”. Both the host step and the path step end the same way when nothing matches:
Host: “If it doesn't find an exact match, it rejects the request with a 404: Bad Request error.” Path: exact match, then wildcard, then “reject the request with a 404: Bad Request error”.
And the trap: “If there are no routing rules for an exact-match frontend host without a catch-all route path (/*), no routing rule will be matched.”
So a host you have correctly registered, with a correctly configured route for /api/*, returns 404 for every other path on that host. The documented example makes it concrete: a profile with only /api/* answers /other with “None. Error 404: Bad Request”.
The path rules reward a careful read, because two of them are counter-intuitive:
| Rule | Consequence |
|---|---|
| A wildcard is “only valid for paths that don't have any other characters after it” and must be preceded by a slash | /img*.png is not a thing |
| “A path that ends in a slash is also an exact-match path” | /path and /path/ are different routes — the worked table sends them to different places |
| Patterns are case insensitive | /FOO and /foo “are treated as duplicates and aren't allowed” — rejected at configuration time |
The published matching table is worth keeping: /abzzz matches the catch-all rather than /ab; /abc/defzzz and /abc/def/ghi both match /abc/* rather than /abc/def. Prefix matching happens only through an explicit wildcard, never implicitly.
Why This Architecture Holds Up
Because caching is the feature most likely to leak data
The documentation puts a warning on this that is unusual in its directness:
“Before you enable caching, thoroughly review the public documentation, and test all possible scenarios before enabling caching… with misconfiguration you can inadvertently cache user specific data that can be shared by multiple users resulting privacy incidents.”
The recommended structure follows from that: “have separate routes for static and dynamic assets, with caching disabled for the latter”. Two guardrails exist in the platform, and both are worth knowing precisely because people rely on them without checking:
- Only GET is cacheable. “All other request methods are always proxied through the network.”
- Authorized requests are excluded — conditionally. “Requests that include authorization header won't be cached, unless the response contains a Cache-Control directive that allows caching” — specifically
must-revalidate,publicors-maxage. An origin that setsCache-Control: publicon an authenticated response defeats the guardrail.
There is a related subtlety on cookies: if the response is cacheable, “the Set-Cookie header is removed before the response is sent to the client”. So the platform's protection against serving one user's session cookie to another is to strip it — which silently breaks any application that expected to set a cookie on a cacheable response.
Because the default cache duration is random
“If the Cache-Control header isn't present on the response from the origin, by default Front Door randomly determines a cache duration between one and three days.”
An origin that says nothing about caching does not get “no caching”, and does not get a predictable TTL either. It gets a random one, up to three days, per object. For a site whose assets are not versioned, that is the difference between a deploy taking effect now and taking effect at an unknown time within three days.
The headers that are honoured, in order, are Cache-Control: s-maxage, then Cache-Control: max-age, then Expires; and private, no-cache and no-store are respected “even if you override the caching behavior by using the Rules Engine”. The ceiling on everything is 366 days.
Because the only validator is Last-Modified
“Azure Front Door uses HTTP cache validators to compare the cached version of a file with the version on the origin server. Azure Front Door supports only Last-Modified… Azure Front Door doesn't support etag.”
Most modern origins emit an ETag and many emit nothing else. Against Front Door that means every revalidation is a full fetch rather than a 304, which shows up as origin load that nobody can account for.
For large objects it gets sharper, and the named example is an Azure service:
“For content larger than 8 MB, origin backend servers should maintain consistent Last-Modified timestamps per asset. Returning inconsistent Last-Modified times from backend servers causes validator mismatch errors and results in partial file downloads or HTTP 5XX failures. Azure Storage might not support consistent Last-Modified timestamps across replicas, which can cause similar validator mismatch errors.”
Front Door in front of Blob Storage serving files over 8 MB is about as mainstream as this service gets, and the documentation says it can produce truncated downloads.
Because 8 MB is the number the cache is built around
| Where 8 MB appears | Behaviour |
|---|---|
| Object chunking | Files are fetched from the origin “in chunks of 8 MB”, with the next chunk prefetched in parallel |
X-Cache header | TCP_HIT / TCP_MISS describe the first 8-MB chunk, not the whole object |
| Chunked Transfer Encoding origins | “response sizes greater than 8 MB aren't supported” |
| Last-Modified consistency | Required above 8 MB, or partial downloads and 5XX |
| Compression (classic) | Files must be between 1 KB and 8 MB inclusive |
There is no cap on file size, but there is a chunk size, and nearly every large-object caveat is a consequence of it. The chunking also depends on something the origin must get right: ranged responses must use status 206 with a Content-Range matching the actual length, “otherwise Azure Front Door doesn't cache the response, and you might see inconsistent behavior”.
And one failure that reads as a platform fault but is a content-negotiation mismatch: if byte-range requests carry Accept-Encoding and the origin answers with differing content lengths, “Azure Front Door will return a 503 error”.
Because the rules engine is ordered, conjunctive, and can stop itself
| Property | Value |
|---|---|
| Match conditions per rule | Up to 10, combined with AND |
| Actions per rule | Up to 5 |
| Evaluation order | Rule sets in configured order; rules within a set in their order |
| Early exit | “Stop evaluating remaining rules” halts all remaining rule sets for the route |
| No match | “only the default route settings get applied” |
| Regex | Supported in conditions |
| Server variables | Supported in actions only |
| Portability | Rules “can't be exported to use across other rule sets” |
Conditions are ANDed, so a rule with ten conditions fires only when all ten hold — there is no OR within a rule, and expressing alternatives means more rules, which is where the per-rule-set count starts to matter. And the asymmetry between regex-in-conditions and server-variables-in-actions is the kind of thing that costs an afternoon if you assume symmetry.
The early exit is the one with blast radius: it stops remaining rule sets, not just remaining rules. A shared security-header rule set placed last will not run for any request that triggered a stop earlier in the chain.
Because the limits are mostly generous and two of them are not
| Limit | Standard | Premium |
|---|---|---|
| Profiles per subscription | 500 | 500 |
| Endpoints per profile | 10 | 25 |
| Custom domains per profile | 100 | 500 |
| Origin groups per profile | 100 | 200 |
| Origins per origin group | 50 | 50 |
| Origins per profile | 100 | 200 |
| Routes / rule sets per profile | 100 / 100 | 200 / 200 |
| Rules per rule set, per route | 100 / 100 | 100 / 100 |
| Origin timeout | 16 to 240 seconds | |
| Bandwidth · requests/sec · WebSockets | 75 Gbps · 100,000 · 1,000,000 | |
| Header size (Private Link origin) | 64 KB (32 KB) | |
| Edge actions | 16 KB code · 3 versions · 10 ms execution | |
Two rows deserve attention. Origins per profile caps at 200 on Premium while the arithmetic of 200 origin groups × 50 origins per group suggests 10,000 — the per-profile limit binds roughly fifty times earlier than the per-group one, so origin groups are cheap and origins are not. And endpoints per profile is 10 on Standard, by far the tightest number in the table and the one most likely to force a second profile.
The edge action figures are new enough to have appeared in this month's roundups — edge actions reached general availability on 10 November — and the 10 ms execution budget is the number that defines what they are for. That is not a place to call anything.
Key Architecture Decisions
| Decision | Choice | Why |
|---|---|---|
| Expecting users to reach their nearest PoP | Don't rely on it | PoP selection happens at DNS resolution and falls back to the resolver's location when the user's is unknown. |
| Anything on Front Door classic | Migrate | Retires 31 March 2027 and already refuses new profiles, new domains and managed certificates. |
| Route coverage | Always define a catch-all /* per host |
Without one, every path you did not enumerate returns 404 on a host that is otherwise correctly configured. |
| Trailing slashes in paths | Treat /path and /path/ as separate routes |
A path ending in a slash is an exact-match path, and the documented table routes them differently. |
| Caching dynamic or authenticated content | Separate routes, caching off | Documented as a privacy-incident risk, and the authorization-header guardrail is defeated by an origin sending Cache-Control: public. |
| Relying on origin cache headers | Always send them explicitly | With no Cache-Control, Front Door picks a random duration between one and three days, per object. |
| Revalidation strategy | Emit Last-Modified, not just ETag |
Front Door supports only Last-Modified; etag is unsupported, so ETag-only origins never get a 304. |
| Large files from Blob Storage through Front Door | Test above 8 MB before relying on it | Inconsistent Last-Modified across replicas causes validator mismatches, partial downloads or 5XX — and Azure Storage is named. |
| Origins using Chunked Transfer Encoding | Keep responses at or below 8 MB | CTE responses larger than 8 MB aren't supported. |
| Shared rule sets placed last | Audit for earlier stop conditions | “Stop evaluating remaining rules” halts every remaining rule set for that route, not just the current one. |
| Expressing OR logic in a rule | Use additional rules | Match conditions within a rule are combined with AND only, capped at 10 per rule. |
| Scaling origins | Count against origins-per-profile, not per-group | 200 per profile on Premium binds roughly fifty times earlier than 200 groups Γ 50 origins would suggest. |
| Standard tier for a multi-endpoint estate | Check the endpoint count first | 10 endpoints per profile on Standard is the tightest limit in the table. |
Closing Thought
Every service in this short run has had one mechanism that decides outcomes before any of your configuration is consulted. For the load balancer it was a hash fed by traffic you do not control. For Application Gateway it was a chain where a break anywhere surfaces at the end. For Front Door it is DNS: the point of presence is chosen while resolving a name, from whatever location the platform can infer, and everything afterwards happens at whichever PoP that produced.
The second theme is that this service's defaults are tuned for a content delivery network rather than for a proxy, and the two have different instincts. A CDN caches unless told otherwise, invents a TTL when the origin is silent, strips cookies from cacheable responses, and rejects unmatched routes outright rather than passing them through. Each of those is correct for serving static assets at the edge and surprising for anyone who arrived expecting a reverse proxy with a cache bolted on.
Only Last-Modified is supported as a validator, and etag is not. An origin that emits only an ETag — which is the modern default for most frameworks and for object storage — will never serve a 304 through Front Door. Nothing errors. The cache still works. The origin just does more work than anyone expects, permanently.
Which leaves one question for the last two posts in this sequence: with four services that all balance traffic, what actually decides which one a given workload needs.
Official Azure Reference
- Caching with Azure Front Door — cacheable methods, object chunking and the 8 MB behaviours, query string modes, the cache expiration header order and the random default, the 366-day ceiling, Last-Modified as the only validator, stripped headers, the X-Cache values and the compression and purge behaviour
- Azure subscription and service limits — the Front Door Standard and Premium service limits, including profiles, endpoints, origin groups and origins, routes and rule sets, bandwidth and request rates, header sizes and the edge action budgets
- Front Door routing architecture — the ordered request pipeline from PoP selection to origin forwarding, the DNS-resolver caveat on PoP choice, where WAF and rule sets and caching sit in the sequence, and the classic retirement notice
- How requests get matched to a route configuration — the most-specific-match principle, exact host matching and the 404 behaviour, the path matching order and wildcard rules, case insensitivity, and the worked matching tables
- What is a rule set? — where rule sets run relative to WAF and routes, evaluation order, the AND-combined ten-condition and five-action structure, the stop-evaluation behaviour, and regex versus server variable support
- Rule set actions — the full action list including route configuration override, for further reading (no claims drawn from it)
- Front Door routing methods — latency, priority, weighted and session affinity origin selection, for further reading (no claims drawn from it)
Comments