API reference up.protocol
module

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. up.protocol.config holds the CSRF token settings.


Features

  • ETag HEADER

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

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

  • If-None-Match HEADER

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

  • Last-Modified HEADER

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

  • _up_method COOKIE

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

  • Configures strings used in the optional server protocol.

  • Vary HEADER

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

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

  • X-Up-Clear-Cache 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 HEADER experimental

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

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

  • X-Up-Events HEADER

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

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

  • 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 HEADER experimental

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

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

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

  • X-Up-Location HEADER

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

  • X-Up-Method HEADER

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

  • X-Up-Mode HEADER

    This request header contains the targeted layer's mode.

  • X-Up-Open-Layer HEADER experimental

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

  • X-Up-Origin-Mode HEADER experimental

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

  • X-Up-Reload-From-Time HEADER deprecated

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

  • X-Up-Target 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 HEADER

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

  • X-Up-Validate HEADER

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

  • X-Up-Version HEADER

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