Throttle Response Directives - Configure - H2O - the optimized HTTP/2 server

# H2O

the optimized HTTP/1.x, HTTP/2 server

×
Powered by Oktavia

## Configure > Throttle Response Directives

The throttle response handler performs per response traffic throttling, when an `X-Traffic` header exists in the response headers.

The value of `X-Traffic` header should be an integer that represents the speed you want in bytes per second. This header CAN be set with `header.add` so that traffic for static assets can also be easily throttled.

The following are the configuration directives recognized by the handler.

since v2.1

### `"throttle-response"`

Description:

  Enables traffic throttle per HTTP response.

  If the argument is `ON`, the traffic per response is throttled as long as a legal `X-Traffic` header exists. If the argument is `OFF`, traffic throttle per response is disabled.

  Example. Enabling traffic throttle per response with static file configuration

      # enable throttle
      throttle-response: ON

      # an example host configuration that throttle traffic to ~100KB/s
      hosts:
        default:
          paths:
            /:
              file.dir: /path/to/assets
              header.add: "X-Traffic: 100000"

Level:
  global, host, path, extension
Default:
  `

      throttle-response: OFF

  `