? my $ctx = $main::context; ? $_mt->wrapper_file("wrapper.mt", "Configure", "Throttle Response Directives")->(sub {

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.

{directive}->( name => "throttle-response", levels => [ qw(global host path extension) ], default => "throttle-response: OFF", since => '2.1', desc => <<'EOT', Enables traffic throttle per HTTP response. EOT )->(sub { ?>

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', <<'EOT') # 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" EOT ?> ? }) ? })