Setting different connection timeouts based on URL path

People sometimes require different connection timeouts based on URL path due to connection time being “slow”. The documentation we have on this only covers changing the connection timeout for all URL paths by directly setting the time under First Byte within your origin settings in the UI. If this doesn’t answer your question, please see below.

Before we proceed, one thing to note is that Fastly enforces a 60 second timeout between nodes unless you’re PASSing requests in vcl_recv. If you want it to be longer than 60 seconds, you should PASS the request.

One way you can do this is by applying connection timeouts by URL path in MISS/PASS.

Say you want the URL path /admin to have a longer timeout of 600 seconds, your VCL would look like the following:

Another way you can implement this is by defining the same backend multiple times with different connection timeouts, and then use an edge dictionary to select the backend with the specific timeouts you want.