demo · v144
Checkout Warmup
A multi-step form (shipping → payment → review → confirm) where the last step is expensive to render. Use prerender_until_script to start warming the confirm page as soon as the user lands on shipping, then activate it the instant they submit. The timeline shows when each step is warmed vs activated.
Behind a flag in 144. Enable
chrome://flags/#enable-experimental-web-platform-features to see navigator.activateSpeculation. The demo runs the choreography either way.
speculationrules until_script: checking…
1. shipping
2. payment
3. review
4. confirm
the API
<script type="speculationrules">
{
"prerender": [{
"urls": ["/checkout/confirm"],
"action": "prerender_until_script"
}]
}
</script>
// when the user finally hits submit
await navigator.activateSpeculation("/checkout/confirm");
location.href = "/checkout/confirm"; // instant swap