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

# `up.protocol`

HTTP headers that let your server inspect and steer Unpoly's rendering.

Request headers tell your server what Unpoly is about to render, and response headers let the server change what Unpoly does with the response. Ready-made implementations exist for popular frameworks, see [Protocol implementations](https://unpoly.com/learn/protocol-implementations.md). [`up.protocol.config`](https://unpoly.com/api/up.protocol.config.md) holds the CSRF token settings.

<nav aria-label="Guides">

- [Learn: Backend integration](https://unpoly.com/learn/backend-integration.md)

</nav>

---

## Features {#features}

- ### [ETag](https://unpoly.com/api/ETag.md) (HTTP header)

  This response header contains a hash identifying the content in the response body.

- ### [If-Modified-Since](https://unpoly.com/api/If-Modified-Since.md) (HTTP header)

  This request header contains the last modification time of a fragment that is being reloaded.

- ### [If-None-Match](https://unpoly.com/api/If-None-Match.md) (HTTP header)

  This request header contains the ETag of a fragment that is being reloaded.

- ### [Last-Modified](https://unpoly.com/api/Last-Modified.md) (HTTP header)

  This response header contains the time when the content in the response body was last modified.

- ### [_up_method](https://unpoly.com/api/_up_method.md) (Cookie)

  The server may set this optional cookie to echo the HTTP method of the initial request.

- ### [up.protocol.config](https://unpoly.com/api/up.protocol.config.md) (Configuration object)

  Configures strings used in the optional server protocol.

- ### [Vary](https://unpoly.com/api/Vary.md) (HTTP header)

  Request headers that influenced a response should be listed in a `Vary` response header.

- ### [X-Up-Accept-Layer](https://unpoly.com/api/X-Up-Accept-Layer.md) (HTTP header)

  The server may set this response header to accept the targeted overlay in response to a fragment update.

- ### [X-Up-Clear-Cache](https://unpoly.com/api/X-Up-Clear-Cache.md) (HTTP header) (deprecated)

  The server may send this optional response header to control which previously cached responses should be expired after this response.

- ### [X-Up-Context](https://unpoly.com/api/X-Up-Context.md) (HTTP header) (experimental)

  This request header contains the targeted layer's context, serialized as JSON.

- ### [X-Up-Dismiss-Layer](https://unpoly.com/api/X-Up-Dismiss-Layer.md) (HTTP header)

  The server may set this response header to dismiss the targeted overlay in response to a fragment update.

- ### [X-Up-Events](https://unpoly.com/api/X-Up-Events.md) (HTTP header)

  The server may set this response header to emit events with the requested fragment update.

- ### [X-Up-Evict-Cache](https://unpoly.com/api/X-Up-Evict-Cache.md) (HTTP header)

  The server may send this optional response header to control which previously cached responses should be evicted when this response is received.

- ### [X-Up-Expire-Cache](https://unpoly.com/api/X-Up-Expire-Cache.md) (HTTP header)

  The server may send this optional response header to control which previously cached responses should be expired when this response is received.

- ### [X-Up-Fail-Context](https://unpoly.com/api/X-Up-Fail-Context.md) (HTTP header) (experimental)

  This request header contains the context of the layer that Unpoly updates when the server sends an error response, serialized as JSON.

- ### [X-Up-Fail-Mode](https://unpoly.com/api/X-Up-Fail-Mode.md) (HTTP header)

  This request header contains the mode of the layer that Unpoly updates when the server sends an error response.

- ### [X-Up-Fail-Target](https://unpoly.com/api/X-Up-Fail-Target.md) (HTTP header)

  This request header contains the target selector that Unpoly updates when the server sends an error response.

- ### [X-Up-Location](https://unpoly.com/api/X-Up-Location.md) (HTTP header)

  The server may set this response header to set a custom browser location after a fragment update.

- ### [X-Up-Method](https://unpoly.com/api/X-Up-Method.md) (HTTP header)

  The server may set this optional response header to change the HTTP method after a fragment update.

- ### [X-Up-Mode](https://unpoly.com/api/X-Up-Mode.md) (HTTP header)

  This request header contains the targeted layer's mode.

- ### [X-Up-Open-Layer](https://unpoly.com/api/X-Up-Open-Layer.md) (HTTP header) (experimental)

  The server can send this response header to force its response to open a new overlay.

- ### [X-Up-Origin-Mode](https://unpoly.com/api/X-Up-Origin-Mode.md) (HTTP header) (experimental)

  This request header contains the mode of the layer from which the interaction originated.

- ### [X-Up-Reload-From-Time](https://unpoly.com/api/X-Up-Reload-From-Time.md) (HTTP header) (deprecated)

  This request header contains a timestamp of an existing fragment that is being reloaded.

- ### [X-Up-Target](https://unpoly.com/api/X-Up-Target.md) (HTTP header)

  The `X-Up-Target` request and response headers allow the server to read or change the target selector for a fragment update.

- ### [X-Up-Title](https://unpoly.com/api/X-Up-Title.md) (HTTP header)

  The server may set this optional response header to change the document title after a fragment update.

- ### [X-Up-Validate](https://unpoly.com/api/X-Up-Validate.md) (HTTP header)

  This request header contains the names of the form fields being validated.

- ### [X-Up-Version](https://unpoly.com/api/X-Up-Version.md) (HTTP header)

  This request header contains the current Unpoly version to mark this request as a fragment update.

