LOG IN SIGN UP
Documentation

Checking multiple backends for a single request

Using a restart is a good option to check multiple backends for a single request. This can be created using a cache setting rule and request headers.

Create a new cache setting rule

Within the Fastly application, navigate to Settings → Cache Settings. Then select the New button to create a cache restart within vcl_fetch.

the a return restart in the new cache settings window

Set the cache settings as follows:

Click Create to add the new cache setting (it will appear in the Cache Settings area). Then click the gear icon next to this new cache setting to add a new condition.

a request restart condition

Set the new condition settings as follows:

Click Create to assign the condition.

Create new request headers

Within the Fastly application, navigate to Content → Headers. Then select the New button to create a request header within vcl_recv.

a new header that creates fastly shielding

Set the header controls as follows:

Click Create to add the new header (it will appear in the Headers area).

Add another header to switch to the next backend.

a new header to switch to the second origin server

Set the next header controls as follows:

Click Create to add the new header (it will appear in the Headers area).

Create new header conditions

Once you've created the new headers, click the gear icon next to each new header rule in the Headers area to add a new condition.

a request restart header condition rule

Set the new condition settings as follows:

Click Create to assign the condition. Then click the Activate button, near the top right corner of the window, to deploy the new version of the service you just edited.