diff --git a/docs/content/routing/providers/docker.md b/docs/content/routing/providers/docker.md index 5726c21bd..eade358c5 100644 --- a/docs/content/routing/providers/docker.md +++ b/docs/content/routing/providers/docker.md @@ -333,9 +333,8 @@ you'd add the label `traefik.http.services..loadbalancer.pa ``` ??? info "`traefik.http.services..loadbalancer.responseforwarding.flushinterval`" - - FlushInterval specifies the flush interval to flush to the client while copying the response body. + See [response forwarding](../services/index.md#response-forwarding) for more information. ```yaml - "traefik.http.services.myservice.loadbalancer.responseforwarding.flushinterval=10" diff --git a/docs/content/routing/providers/marathon.md b/docs/content/routing/providers/marathon.md index 13e730eb5..10478c39e 100644 --- a/docs/content/routing/providers/marathon.md +++ b/docs/content/routing/providers/marathon.md @@ -253,10 +253,9 @@ For example, to change the passHostHeader behavior, you'd add the label `"traefi ``` ??? info "`traefik.http.services..loadbalancer.responseforwarding.flushinterval`" - - - FlushInterval specifies the flush interval to flush to the client while copying the response body. + See [response forwarding](../services/index.md#response-forwarding) for more information. + ```json "traefik.http.services.myservice.loadbalancer.responseforwarding.flushinterval": "10" ``` diff --git a/docs/content/routing/providers/rancher.md b/docs/content/routing/providers/rancher.md index 17c220457..4adb45614 100644 --- a/docs/content/routing/providers/rancher.md +++ b/docs/content/routing/providers/rancher.md @@ -259,10 +259,9 @@ you'd add the label `traefik.http.services.{name-of-your-choice}.loadbalancer.pa ``` ??? info "`traefik.http.services..loadbalancer.responseforwarding.flushinterval`" - - - FlushInterval specifies the flush interval to flush to the client while copying the response body. + See [response forwarding](../services/index.md#response-forwarding) for more information. + ```yaml - "traefik.http.services.myservice.loadbalancer.responseforwarding.flushinterval=10" ``` diff --git a/docs/content/routing/services/index.md b/docs/content/routing/services/index.md index f9924677a..3efcffd4d 100644 --- a/docs/content/routing/services/index.md +++ b/docs/content/routing/services/index.md @@ -346,7 +346,39 @@ By default, `passHostHeader` is true. loadBalancer: passHostHeader: false ``` + +#### Response Forwarding +This section is about configuring how Traefik forwards the response from the backend server to the client. + +Below are the available options for the Response Forwarding mechanism: + +- `FlushInterval` specifies the interval in between flushes to the client while copying the response body. + It is a duration in milliseconds, defaulting to 100. + A negative value means to flush immediately after each write to the client. + The FlushInterval is ignored when ReverseProxy recognizes a response as a streaming response; + for such responses, writes are flushed to the client immediately. + +??? example "Using a custom FlushInterval -- Using the [File Provider](../../providers/file.md)" + + ```toml tab="TOML" + ## Dynamic configuration + [http.services] + [http.services.Service-1] + [http.services.Service-1.loadBalancer.responseForwarding] + flushInterval = "1s" + ``` + + ```yaml tab="YAML" + ## Dynamic configuration + http: + services: + Service-1: + loadBalancer: + responseForwarding: + flushInterval: 1s + ``` + ### Weighted Round Robin (service) The WRR is able to load balance the requests between multiple services based on weights.