---
name: "X-Up-Mode"
area: "API"
kind: "HTTP header"
parent: "up.protocol module"
url: "https://unpoly.com/api/X-Up-Mode"
---
<nav aria-label="Unpoly docs">[All docs](https://unpoly.com/index.md) · [up.protocol module](https://unpoly.com/api/up.protocol.md)</nav>

# X-Up-Mode

This request header contains the targeted layer's [mode](https://unpoly.com/api/up.layer.mode.md).

Server-side code is free to render different HTML for different modes. For example, you might prefer to not render a site navigation for overlays.

## Example {#example}

The user updates a fragment `main` within a [drawer overlay](https://unpoly.com/learn/overlays.md#layer-modes). Unpoly automatically includes the following request headers:

```http
X-Up-Mode: drawer
X-Up-Target: main
```

The server chooses to render only the HTML required for the overlay. It responds with the following HTTP:

```http
Vary: X-Up-Mode

<main>...</main>
```

> #### Note
>
> Request headers that influenced a response should be listed in a [`Vary`](https://unpoly.com/api/Vary.md) response header. This tells Unpoly to [partition its cache](https://unpoly.com/learn/optimizing-responses.md#vary) for that URL so that each request header value gets separate cache entries.

