Search
Varnish Cache Plus

Timeouts

Varnish 6.0

Varnish Plus offers extra facilities to modify a couple of timeouts from the VCL. This allows users to override them on a per-request basis and to leave the general setting intact.

last_byte_timeout

Description

last_byte_timeout is the amount of time, in seconds, to wait for a complete backend response. A value of 0 means this setting is not used. This parameter has a default value of 0. This can be set with a varnishd -p parameter, a backend definition or bereq variable.

Example

sub vcl_backend_fetch {
        # Give all requests with a URL ending in
        # .zip 4 seconds to finish
        if (urlplus.get_extension() == "zip") {
	        set bereq.last_byte_timeout = 4s;
        }
}

send_timeout

Description

send_timeout is the upper limit for Varnish to send a response to client. Once this time limit is reach, Varnish will abort the transaction to reclaim resources.

It can be set in VCL using the resp.send_timeout variable.

Example

sub vcl_delivery {
	# ISO files are large and may need up to 30 minutes to be downloaded
	if (urlplus.get_extension() == "iso") {
		set resp.send_timeout = 30m;
	}
}