up.protocol
JavaScript namespace
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.
-
If-Modified-Since HEADER
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.
-
The server may set this optional cookie to echo the HTTP method of the initial request.
-
up.protocol.config CONFIG
Configures strings used in the optional server protocol.
-
Vary HEADER
Request headers that influenced a response should be listed in a
Varyresponse header. -
X-Up-Accept-Layer HEADER
The server may set this response header to accept the targeted overlay in response to a fragment update.
-
The server may send this optional response header to control which previously cached responses should be expired after this response.
-
This request header contains the targeted layer's context, serialized as JSON.
-
X-Up-Dismiss-Layer HEADER
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.
-
X-Up-Evict-Cache 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 HEADER
The server may send this optional response header to control which previously cached responses should be expired when this response is received.
-
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 HEADER
This request header contains the mode of the layer that Unpoly updates when the server sends an error response.
-
X-Up-Fail-Target HEADER
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.
-
The server can send this response header to force its response to open a new overlay.
-
This request header contains the mode of the layer from which the interaction originated.
-
This request header contains a timestamp of an existing fragment that is being reloaded.
-
X-Up-Target HEADER
The
X-Up-Targetrequest 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.