HTTP headers
The two halves only meet on redirect following, through these headers:
| Header | Direction | Set by | Read by |
|---|---|---|---|
Turbo-Frame |
request | Turbo, on frame requests: the id of the frame | TurboManager, the turbo_frame filter, TurboHandler |
X-Turbo-Request-Id |
request | Turbo 8+, on its fetch requests (Turbo 7 does not send it) | TurboManager::isTurboRequest(), for DELETE redirects and 303s; getTurboRequestId() and turbo_request_id() |
Accept |
request | Turbo 7+, on its form submissions: text/vnd.turbo-stream.html first |
TurboManager::isTurboRequest(), for DELETE redirects and 303s |
Turbo-Frame-Follow-Redirect |
request | TurboHandler, value 1, for frames with data-turbo-follow-redirect |
TurboManager::followTurboFrameRedirect(), TurboFrameListener |
Turbo-Location |
response | TurboFrameListener, on a 204 replacing a redirect: the original Location |
TurboHandler, which calls onRedirect |
Vary: Turbo-Frame |
response | TurboFrameListener, when the request read Turbo-Frame through TurboManager (the turbo_frame filter, turbo_frame_request()…) |
shared caches: the frame layout of a URL is not served to a full visit, or the other way round |
Vary: Accept |
response | TurboFrameListener, when the request called acceptsTurboStream() (or isTurboRequest()) |
shared caches: the stream answer of a data-turbo-stream link is not served to a full visit |
Any backend can drive TurboHandler by answering Turbo-Location, and any client can use TurboFrameListener by
following it: see Without @silarhi/turbo.
