---
title: resolve_backend
summary: Resolve backend name and final URL for a request.
url: https://www.fastly.com/documentation/reference/compute/sdks/python/fastly_compute/requests/backend/fn.resolve_backend/
---

**Kind:** Function  
**Module:** [backend](https://www.fastly.com/documentation/reference/compute/sdks/python/fastly_compute/requests/backend/)  
**Package:** fastly-compute 0.1.3  
**Source:** https://github.com/fastly/compute-sdk-python/blob/2bffcc6d596a68bcc0b4342404641deff78e68f6/fastly_compute/requests/backend.py#L35

```python
resolve_backend(url: str, fastly_backend: str | None = None, timeout_config: TimeoutConfig | None = None) -> BackendResolution
```

Resolve backend name and final URL for a request.

This function determines which Fastly backend to use for a request:
- If `fastly_backend` is provided, attempts to open that pre-configured static backend
- Otherwise, registers/reuses a dynamic backend based on the URL's netloc

Static backends must already be configured in the Fastly service.
Dynamic backends are automatically registered on first use and cached for reuse.

**Parameters**

- `url`: `str` — The URL to request (must be full with scheme and netloc for dynamic backends)
- `fastly_backend`: `str | None` (optional) = `None` — Optional static backend name
- `timeout_config`: `TimeoutConfig | None` (optional) = `None` — Optional timeout configuration for dynamic backends

**Returns**

`BackendResolution`

ResolutionResult containing backend and updated parsed url

**Throws**

- [RequestException](https://www.fastly.com/documentation/reference/compute/sdks/python/fastly_compute/requests/exceptions/class.RequestException/) — If backend resolution fails
- [MissingSchema](https://www.fastly.com/documentation/reference/compute/sdks/python/fastly_compute/requests/exceptions/class.MissingSchema/) — If URL is missing scheme (subclass of RequestException)
