Shortening LCP with Speculation Rules Prefetch and Prerender
If you prerender the page the user is likely to open next with Speculation Rules, the page is already rendered in the background when the link is clicked, so its LCP after navigation is close to 0. In my test environment, the LCP of the next page was 540ms without speculation. With prefetch it was 140ms, and with prerender it was 20–28ms. However, if the speculation has not finished by the time of the click, only the part that was already completed gets shortened.
This works on sites where you can predict the next page, such as article list to article, product list to product page, or search results to detail page, and where you want faster display when navigating between those pages.
The test environment was Ubuntu 24.04, Node.js 22.23.4, and web-vitals 6.2.3. The browser was Chrome for Testing 153, which ships with Playwright 1.63.0. I ran it in a headed mode on a virtual display with Xvfb, not headless, and moved the mouse with xdotool. The server was written with Node.js's http module. To simulate a distant server, I placed a TCP relay that delayed responses by 100ms. Unless noted otherwise, the numbers are medians of 5 runs, each in a new profile. I did not test smartphones, Firefox or Safari, real internet connections, prefetching across different origins, or field data from real users.
The difference between prefetch and prerender
Speculation Rules are written as JSON inside <script type="speculationrules">, and they specify which URLs to speculatively load and how. According to MDN's explanation of speculationrules, there are two kinds of speculation:
prefetch: Fetches only the HTML of the next page. It does not fetch images or other resources the page uses.prerender: Loads the next page in a hidden tab, and completes resource loading such as images and JavaScript execution.
In the test, I created a /start page instead of a list page, with one link to /next. The /next page took 300ms for the server to process, and used a 600×400 image as its LCP element. On /start, you would include a rule like this:
<script type="speculationrules">
{"prerender":[{"urls":["/next"],"eagerness":"immediate"}]}
</script>
For prefetch, you only change "prerender" to "prefetch". The server received the speculative requests with a Sec-Purpose header. With prefetch, the header was prefetch; with prerender, it was prefetch;prerender. For prerender, the LCP image (/hero.png) also arrived with the same header before the click.
LCP for each type of speculation
About 2 seconds after launching the browser (about 1.5 seconds after prerendering started), I clicked the link to move to /next, and measured the LCP of /next with web-vitals.
| Speculation | LCP | TTFB | navigationType |
|---|---|---|---|
| None | 540ms | 407.5ms | navigate |
| prefetch | 140ms | 2.7ms | navigate |
| prerender | 28.1ms | 0ms | prerender |
With prefetch, the HTML was already available locally, so TTFB dropped from 407.5ms to 2.7ms. However, the image was still fetched after the click. The resourceLoadDuration in the LCP breakdown (image loading time) remained at 102.9ms, so the LCP was 140ms.
With prerender, the page was already displayed with its image by the time of the click, so TTFB, resourceLoadDelay, and resourceLoadDuration were all 0. Only elementRenderDelay remained, at 28.1ms.
For a prerendered page, the LCP is measured from the time the user navigates to the page (activationStart), not from when loading started. Chrome's prerender explanation also says that Core Web Vitals for a prerendered page are measured from the time it is switched to display, so LCP is often close to 0. In my test, the LCP times recorded by the browser were 1508–1632ms, and subtracting activationStart (1482–1593.5ms) from them gave the LCP reported by web-vitals.
If speculation is not in time, only part of the gain is achieved
Speculation has a smaller effect if it has not finished by the time of the click. I also measured the case with prerender set to immediate and a click about 50–130ms after speculation started.
| Time from prerender start to click | LCP | TTFB |
|---|---|---|
| About 1.5 seconds (loading had finished) | 28.1ms | 0ms |
54–134ms (values of activationStart) |
447.8ms | 318.7ms |
Even when the click happened mid-way, the prerendered page was not discarded and was used for display (navigationType was prerender). Only the part that had already progressed was saved, and the LCP went from 540ms to 447.8ms.
Choosing the trigger for speculation with eagerness
eagerness determines when speculation starts. In Chrome's explanation of speculation triggers and limits, the following applies on desktop:
immediate: starts as soon as the rule is foundeager: starts when the mouse hovers over the link for 10msmoderate: starts when the mouse hovers over the link for 200ms (or on press, if the link is pressed before that)conservative: starts when the link is pressed with a mouse button or finger
The default for the URL-list form (urls) is immediate, and the default for the form that selects links on the page by condition (where) is conservative. When you do not know which link will be clicked, such as on a list page, you can use where to select the target links and use hovering as the trigger.
<script type="speculationrules">
{"prerender":[{"where":{"href_matches":"/next"},"eagerness":"moderate"}]}
</script>
I changed the time between hovering over the link with the mouse and clicking it, using moderate, and measured the results.
| Time from hover to click | LCP | activationStart |
|---|---|---|
| 1000ms | 19.9ms | 803–804.7ms |
| 300ms | 432.7ms | 101.9–104.1ms |
With a 1-second hover, prerendering started 200ms after the hover, and the page had finished loading by the click about 800ms later, so the LCP was 19.9ms. With a 300ms hover, the click came about 100ms after prerendering started, so only about 100ms of the work was saved.

With conservative, and with moderate when the link was pressed right after hovering, the LCP barely improved. With conservative, a Sec-Purpose: prefetch;prerender request reached the server when the link was pressed, but in all 5 runs navigationType was navigate and activationStart was 0, so the page was not treated as a prerendered page. The LCP recorded by the browser was 532–540ms, the same as without speculation. With moderate pressed right after hovering, 4 of 5 runs were the same. In the remaining run, activationStart was 4.3ms.
Which eagerness to choose depends on how likely the speculated page is to be opened. Chrome's explanation recommends prerendering only pages that are likely to be opened, because over-speculating uses network bandwidth, memory, and CPU. There is also a limit on how many speculations can be held at once. On desktop, eager, moderate, and conservative allow up to 2 prerenders; beyond that, the oldest ones are cancelled.
Prerender does not work when opened from Playwright
The first problem in this test was how to measure. When I opened the page and clicked with Playwright (chromium.launch()), the server received a Sec-Purpose: prefetch;prerender request, but the LCP image was loaded only after the click, and navigationType was navigate. When I checked the speculation state through the Chrome DevTools Protocol Preload domain, the prerender had failed:
prerenderStatusUpdated {"key":"Prerender",…,"status":"Failure","prerenderStatus":"PrerenderingDisabledByDevTools","url":"http://localhost:9080/next"}
I also launched Chromium headless directly and connected only over a CDP WebSocket, and got the same PrerenderingDisabledByDevTools. In both cases, only the HTML fetched by prefetch was used. The LCP measured once in each case was 124ms with Playwright and 140ms with the direct connection, which is about the same as prefetch.
So for the main measurements, I did not connect CDP. Instead, I opened Chromium on the Xvfb display and clicked by actually moving the mouse with xdotool. The result was sent from the /next page to the server with navigator.sendBeacon(). Whether prerender was used can be checked by whether activationStart is greater than 0, or whether web-vitals' navigationType is prerender. document.prerendering is also a clue, but if the click happens right after prerendering starts, the page switches to display before the HTML arrives, so when the script ran it was false.
When web-vitals did not return an LCP
In all 5 conservative runs, and in 4 of 5 moderate runs with the mouse pressed right after hovering, web-vitals' onLCP did not return a value, even with reportAllChanges: true. The browser still held the LCP record (such as 532ms), and it could be read with PerformanceObserver.
On these pages, activationStart was 0, and the visibility-state record began with hidden at time 0, like hidden@0, visible@412. web-vitals 6.2.3's process that determines when the page was hidden (getVisibilityWatcher.ts) takes the first hidden time after activationStart as the time the page was hidden, and the process that computes LCP (onLCP.ts) uses only LCP entries before that time. As a result, the page was treated as hidden from time 0, and the LCP was discarded. In this test environment, web-vitals' LCP went missing when prerendering started just before the click. If the number of LCP values on your site is smaller than the number of page views, comparing against values taken with PerformanceObserver can give you a clue.
On a prerendered page, JavaScript runs before the user opens it. Access-analysis page views, and processes that record a page as shown, may run even for pages that are never opened. Chrome's explanation describes checking document.prerendering to see whether the page is being prerendered, and running the code only after it switches to display, using the prerenderingchange event.





