Speculation Rules prefetch and prerender
A page can load a likely next page early, so a site may see a request before the person visits.
In one line
Can load a likely next page early, so a site may see a visit first
A page can load a likely next page early, so a site may see a request before the person visits.
Prefetch or prerender makes the destination server log a hit, and run scripts, before any click, sending Sec-Purpose: prefetch;prerender. Analytics can over count; cookies from a prefetched response apply only on activation.
What it can and can't do
What the user does: Nothing. It happens when a page guesses where you will go next
It can
- Load a likely next page before you click
- Show the next page almost instantly when you click
- Let the next site see a request before you visit
It cannot
- Run in Firefox or Safari
- Run when Chrome's data saver is on or the connection is poor
- Show you the page until you click, or count it as a visit in some tools
- Load pages from a different site without extra signals
How it differs between platforms: Chrome, Edge and Samsung Internet support it. Firefox and Safari do not.
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 108 | 2022-11-29 | None |
| Edge | Supported | 108 | 2022-12-05 | None |
| Firefox | Not supported | Not available | Not listed | None |
| Safari | Not supported | Not available | Not listed | Not supported at time of research, verify |
| Safari on iPhone | Not supported | Not available | Not listed | None |
| Chrome on Android | Supported | 108 | 2022-11-29 | None |
| Samsung Internet | Supported | 21.0 | 2023-05-19 | None |
How a site asks for it
| API | <script type=speculationrules>; Sec-Purpose request header; document.prerendering |
| Browser compat keys | api.Document.prerenderinghttp.headers.Sec-Purpose |
| How access is granted | none |
| What the user sees | None |
| Needs a secure context (HTTPS) | No |
| Needs a user gesture | No |
| How long it lasts | Prefetch cache about 5 minutes in Chrome |
| How to take it back | Clear site data, browser privacy settings |
| Inside an iframe | Not listed |
Data you get
What comes back: Sec-Purpose request header
Shape: string
How often: per speculative request
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
Sec-Purpose | string | token | prefetch, prefetch;prerender | enum |
Technical limits
- Same-site prefetch carries cookies; cross-origin uses an isolated session without them
- Not done when Data Saver or Save-Data is on, or in low memory
- Chrome limits concurrent prefetch and prerender counts
The story
What it is
A page can load a likely next page early, so a site may see a visit before you click.
For you
You click a link and the next page appears almost at once. Behind the scenes, the browser loaded it before you clicked. The site may log a hit even if you never open it.
For makers
Instant page loads raise sales and reading time. But prefetching makes the server count a visit early and can run scripts before you arrive. Analytics must wait for activation to avoid inflated numbers.
Where you see it
| Type | Example | Apps |
|---|---|---|
| shopping | A shop prerenders the product page you are likely to open, so checkout feels fast. | Shopify, Amazon |
| media | A news site prefetches the next article so it opens instantly. | The Guardian |
| games | A game portal prefetches the page of the game you hover over, so it loads in a blink. | Poki, CrazyGames |
| analytics | A tool must ignore hits from prefetched pages, or visit counts go up. | Google Analytics |
| ads | An ad system waits for activation before it counts an impression. | Google Ad Manager |
| utilities | A search result page prerenders the top result so it opens at once. | Google Search |
Risks
- Server sees visits you never made
- Can inflate analytics
What the platform says
- Google Chrome: Prerender pages. Chrome says speculation rules can load pages ahead of time so the next click feels instant.
Good uses and abuse
Legitimate uses
- Instant navigations
Known abuse
- Phantom page views, privacy leak of intent before click
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 2 of 5 | How revealing the data is |
| Utility | 4 of 5 | How useful it is to honest apps |
| Friction | 0 of 5 | How much the user has to do |
| Fingerprint bits | Not rated | Rough identifying entropy, when known |
History
- 2022-11, Chrome 108: Prerender2 shipped for omnibox and speculation rules
- 2024-04, Chrome 121: Speculation Rules eagerness, document rules
Related capabilities
Related
- Referer header and Referrer-Policy default. Can tell a site which page you came from, trimmed to the site name cross site
Sources
How well checked: Based on official documentation.