demo · v146
Live Search Prerender
A real search form with a real speculation rule on the page. Type, blur, and submit — and watch the results render instantly because the destination was already painted in the background.
form_submission field, the rule above is a no-op and submission falls back to a regular navigation. The page still works, just without the speed boost.
try editing the query and submitting — the destination at ./results.html?q=… is the same regardless of the query string, but the prerender warms it ahead of time.
the rule on this page
<script type="speculationrules">
{
"prerender": [
{
"where": {
"form_submission": {
"action": "./results.html",
"method": "GET",
"request_with": { "params": ["q"] }
}
},
"eagerness": "moderate"
}
]
}
</script>
The form_submission matcher tells Chrome: "if a form with this action, this method, and these named params is about to submit, prerender the resulting URL." When the user actually hits Enter, the prerendered document activates instantly instead of being fetched and parsed from scratch. Per the WICG explainer, this closes the single most-requested gap in speculation rules: GET-form submissions on search pages.
see also
- Speculation rules: form_submission field — feature index
- Speculation Rule Builder — sibling concept
- WICG explainer
- Chrome team reference demo
- ChromeStatus entry