RTIME, can be read and set, but not unset.

Available inpassmiss

The amount of time Fastly should wait for a backend server to deliver the first byte of an HTTP response body, before triggering a timeout.

May be set to any value between 0 and 600s. By default, the timeout is 15s.

If the timeout is triggered, Fastly will create an error object and invoke vcl_error with obj.status set to 503 and obj.response set to "first byte timeout". Learn more about errors.

Effects of shielding and clustering

If clustering or shielding is enabled, the request will pass through more than one Fastly server before it is sent to the origin. Each Fastly server will consider the next Fastly server to be an origin and apply a separate first byte timeout.

The timeout between nodes in a cluster is always 60s and is not configurable. This means that, for services with clustering enabled, the effective maximum bereq.first_byte_timeout is 60s.

The timeout between POPs in a shielding arrangement is affected by the settings in each case, since the full VCL configuration will be executed at each POP separately. For example, to set a timeout that applies only when connecting to the origin and not when connecting to an upstream shield POP, use the following VCL:

sub vcl_miss { ... }
Fastly VCL
if (req.backend.is_origin) {
set bereq.first_byte_timeout = 10s;

Longer timeouts

To set a timeout of more than 60 seconds, you must perform the fetch to your origin server directly from the first Fastly server that handles the request. You can do this in two ways:

  • Mark the request as a PASS by executing return(pass) in vcl_recv. Responses will not be cached.
  • Disable clustering and shielding. Cache hit ratio will be severely reduced.

In such cases, consider limiting this behavior to only the URLs that require an extreme timeout. For example, the following code sets a 5-minute first byte origin timeout and passes the request for all requests to paths starting with /slow/response:

if (req.url ~ "^/slow/response") {
set bereq.first_byte_timeout = 300s;