Skip to content

Commit f453d5f

Browse files
authored
Merge pull request #299889 from jaesoni/sse-preview
Sse preview
2 parents 712d750 + eacc9bb commit f453d5f

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

articles/application-gateway/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,8 @@
289289
href: ../reliability/migrate-app-gateway-v2.md?toc=/azure/application-gateway/toc.json
290290
- name: Proxy buffer configuration
291291
href: proxy-buffers.md
292+
- name: Using Server-sent events
293+
href: use-server-sent-events.md
292294
- name: Custom error pages
293295
href: custom-error.md
294296
- name: Migrate to v2 SKU
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
title: Using Server-sent events with Application Gateway (Preview)
3+
description: This article provides guidance for using Server-sent events with your Azure Application Gateway.
4+
services: application-gateway
5+
author: jaesoni
6+
ms.service: azure-application-gateway
7+
ms.topic: concept-article
8+
ms.date: 05/15/2025
9+
ms.author: jaysoni
10+
---
11+
12+
# Using Server-sent events with Application Gateway (Preview)
13+
14+
Azure Application Gateway offers support for Server-sent events (SSE). This document provides guidelines to ensure the seamless operation of this feature when used with Azure Application Gateway.
15+
16+
> [!Note]
17+
> - The SSE support with Azure Application Gateway is currently in Preview phase.
18+
> - The response time recorded in [Access logs](monitor-application-gateway-reference.md#resource-logs) represents the total duration for which the connection was established. Multiple event streams may pass through during this connection period.
19+
20+
## Configuring Application Gateway
21+
22+
### Response Buffer
23+
24+
The [Response Buffers on Application Gateway resource](proxy-buffers.md) should be disabled. This configuration enables your application gateway resource to send responses to clients as streams from the backend server are received.
25+
26+
### Backend Setting - Request timeout
27+
28+
Ensure that the [Request time-out (seconds) in Backend Settings](configuration-http-settings.md?tabs=backendhttpsettings#request-timeout) is configured to exceed the idle time between events. Otherwise, your application gateway resource terminates the connection prematurely.
29+
30+
31+
## Configuring backend server
32+
33+
The backend server should send the following Response headers to ensure proper stream handling by the clients and any intermediaries. Note, these headers aren't a requirement for Application Gateway as a proxy.
34+
35+
### Content-Type: text/event-stream
36+
This header notifies the client that the response will be a stream of events, enabling them to correctly handle the Server-sent events (SSE) protocol.
37+
38+
### Connection: keep-alive
39+
This header maintains the TCP connection, allowing the backend server to send events to the client continuously.
40+
41+
### Transfer-Encoding: chunked
42+
This header allows the server to send responses in chunks without requiring a Content-Length header. It's necessary for streaming responses through SSE when the total size can't be determined in advance.
43+
44+
### Cache-Control: no-cache
45+
It's advisable to use this header to prevent intermediaries like CDNs from caching the SSE response.
46+
47+
## Next steps
48+
Learn about [Request and Response Proxy Buffers](proxy-buffers.md) in Application Gateway.

0 commit comments

Comments
 (0)