Measuring Server-Sent Events delivery across Origin and Akamai CDN
Server-Sent Events — a W3C spec from 2006 — has become the protocol powering every major LLM streaming interface.
| Provider | Protocol | Use Case |
|---|---|---|
| OpenAI (ChatGPT) | text/event-stream | Token streaming for completions |
| Anthropic (Claude) | text/event-stream | Streaming message responses |
| Google (Gemini) | text/event-stream | Real-time model output |
| xAI (Grok) | text/event-stream | Streaming chat completions |
| Cohere | text/event-stream | Streaming chat + embeddings |
Standard web delivery assumptions break down with Server-Sent Events. Most organizations deploying LLM applications inherit SSE infrastructure requirements they don't understand.
Two delivery paths measured with identical SSE payloads. Each event carries a server-side high-resolution timestamp for precise latency measurement.
Simultaneous SSE streams on both paths. Same event IDs, same client clock — which path delivers each event first?
| ID | Origin | Akamai | Delta | Winner |
|---|---|---|---|---|
| Start a comparison to see matched event pairs... | ||||
Connection phase breakdown for both paths via Resource Timing API. Run a comparison to populate.
CDN delivery for SSE provides real security and connectivity value, but the traditional caching model doesn't apply. Here's what you gain and what you give up.
| Capability | Detail |
|---|---|
| TLS Termination at Edge | Clients negotiate TLS with nearest edge PoP — lower handshake latency, reduced origin TLS load |
| DDoS Absorption | Edge absorbs volumetric and connection-flood attacks before they reach origin |
| Bot Management | Behavioral detection and challenge mechanisms filter malicious clients at edge |
| WAF (Request Inspection) | Request headers, query params, and POST bodies inspected at edge before forwarding |
| Observability (DataStream) | Per-connection logging, timing data, and real-time telemetry without instrumenting origin |
| Global DNS & Routing | Anycast DNS routes clients to optimal edge PoP — lower RTT for geographically distributed users |
| Limitation | Detail |
|---|---|
| Zero Connection Offload | Every client SSE connection requires a corresponding origin connection — 0% cache hit rate |
| Latency Overhead (~20ms) | Edge-to-origin hop adds measurable latency to every event delivery |
| Buffering by Default | Without advanced metadata configuration, edge buffers responses — breaking real-time delivery |
| 1:1 Origin Connections | No connection coalescing — origin must be sized for full concurrent client count |
| WAF Can't Inspect Streams | Response body inspection fails on chunked, long-lived streams — must exempt SSE paths |
| Advanced Config Required | Critical settings (buffer-response-v2, chunk-to-client) require PS engagement — not in Property Manager UI |
Critical configuration required to deliver SSE through Akamai without buffering. Advanced metadata requires Professional Services engagement.
| Behavior | Setting | Purpose | UI Available? |
|---|---|---|---|
| Caching | NO_STORE | Prevent edge caching of SSE | Yes |
| Downstream Cache | BUST | Prevent client/intermediate caching | Yes |
| Allow Transfer Encoding | enabled | Enable chunked transfer | Yes |
| Response Buffer | off | Disable edge response buffering | No (metadata) |
| Origin Timeout | 600s | Allow long-lived SSE connections | Product-dependent |
These behaviors are not available in Property Manager UI and require Akamai PS or TAM engagement. Without them, the edge buffers SSE responses, breaking real-time delivery.
| Metadata Tag | Value | Effect |
|---|---|---|
http.buffer-response-v2 | off | Disables edge response buffering — events forwarded immediately |
http.chunk-to-client | on | Enables chunked encoding to the client |
http.forward-chunk-boundary-alignment | on | Preserves chunk boundaries from origin |
lma.origin-edge | off | Disables last-mile acceleration (origin to edge) |
lma.edge-browser | off | Disables last-mile acceleration (edge to browser) |
| Concern | Impact on SSE | Recommendation |
|---|---|---|
| Response body inspection | Cannot buffer streaming response | Exempt /events from response inspection |
| Rate limiting | 1 SSE connection = 1 HTTP request | Limit per-connection, not per-request |
| Bot detection | API clients lack browser signals | Whitelist SSE client User-Agents |
| Slow POST detection | Long-lived connections appear idle | Increase thresholds for SSE paths |
| Layer | Default | SSE Setting | Configuration |
|---|---|---|---|
| Edge → Client | 120s | <120s heartbeat | Server sends : heartbeat every 15-30s |
| Edge → Origin | 120s | 600s | Origin timeout behavior |
| HAProxy | 30s | 600s+ | timeout-server, timeout-tunnel |
| Browser EventSource | auto-reconnect | 3000ms | Server sends retry: 3000 |
With HTTP/1.1, every SSE client stream requires a separate TCP+TLS connection from Akamai edge to origin. HTTP/2 multiplexes all streams over a single connection — eliminating redundant handshakes and reducing origin connection pressure.
Open N concurrent SSE streams via both H1 and H2 origin paths through Akamai simultaneously. The per-stream TTFB waterfall reveals the multiplexing benefit: H2 streams 2–N skip TCP+TLS setup.
Moving event generation to the edge. Instead of proxying every stream back to origin, distribute SSE publishing across edge compute nodes.