---
title: fastly.try_select_shield
summary: null
url: >-
  https://www.fastly.com/documentation/reference/vcl/functions/miscellaneous/fastly-try-select-shield
---

```
BACKEND fastly.try_select_shield(BACKEND shield, BACKEND fallback)
```

**Available in:** all subroutines

Function to selectively return a shield director if all of the following are true:

- The director points to a valid Fastly shield and is healthy
- It has not previously been visited in this request

Otherwise, the fallback director is returned.

This enables the specified shield site to be selected as a backend only once during
a request's lifecycle, without the need to inspect headers or use a Fastly POP by its
IATA identifier.

## Example

```vcl
sub vcl_miss {
  set req.backend = fastly.try_select_shield(ssl_shield_iad_va_us, req.backend);
}
```
