Custom extend Admin timeout VCL
Fastly has a strict timeout for the Magento Admin of three minutes. This may not be enough time for some extended actions. To extend the default timeout for the Magento Admin, you will create a new VCL snippet with a priority of 100 and a longer timeout value. This VCL snippet value will run last and override the default value in
pass.vcl with a priority of 50 (already uploaded to your service).
To build the new command, we took the default code and revised it with a new name (
extendtimeout) and lower priority value. The order of priorities will use this value over the default 180 seconds. How did you set the default timeout? When you first uploaded your VCL snippets when configuring Fastly, you uploaded a default VCL with a default timeout of 180 seconds (three minutes). The VCL snippet uploaded was from this Fastly pass.vcl snippet.
The important code that sets the timeout is the
first_byte_timeout value of 100. For this snippet, you can extend this time to 300s for five minutes or 600s for ten minutes. Ten minutes is the hard cap for Fastly timeouts. In this code example, we extend the timeout to ten minutes.
This information is just the code portion for setting up your VCL. Use this information with Custom Fastly VCL snippets.
To extend the timeout for the Magento Admin to Staging and Production environments, you can use the same VCL snippet file without edits.
extendtimeout.json file with the following JSON content:
Review the following values for the code to determine if you need to make changes:
name: Name for the VCL snippet. For this example, we used the name
priority: Determines the order VCL snippets call. You want the priority set to 100 to be the last run and overwrite the default
type: For this VCL, we use
content: The code that runs. For this snippet, we change the
set bereq.first_byte_timeoutwith a higher value. For example, 300s for five minutes or 600s for ten minutes. Ten minutes is the hard cap for Fastly timeouts.
The default VCL snippets you uploaded included a prepended name of
magentomodule_ with a priority of 50. For your custom VCL snippets, do not use the
magentomodule_ name. Also consider the priority of your custom snippets if they should override the default snippets.
Finish adding the VCL
When saved, continue creating other VCLs. You can then run the bash script, then validate and activate your VCLs to complete the process. For complete steps, see Custom Fastly VCL snippets.