[{"data":1,"prerenderedAt":961},["ShallowReactive",2],{"content:\u002Fnetwork-protocol-optimization\u002Fspeculative-loading-and-prefetching\u002Fprerender-vs-prefetch-cost-trade-offs":3,"surroundings:\u002Fnetwork-protocol-optimization\u002Fspeculative-loading-and-prefetching\u002Fprerender-vs-prefetch-cost-trade-offs":952},{"id":4,"title":5,"body":6,"description":932,"extension":933,"meta":934,"navigation":945,"path":946,"seo":947,"stem":950,"__hash__":951},"content\u002Fnetwork-protocol-optimization\u002Fspeculative-loading-and-prefetching\u002Fprerender-vs-prefetch-cost-trade-offs\u002Findex.md","Prerender vs Prefetch Cost Trade-Offs",{"type":7,"value":8,"toc":914},"minimark",[9,14,38,41,154,159,187,191,197,203,209,215,219,224,227,464,468,471,475,482,486,496,606,610,616,620,623,627,634,697,701,707,711,737,741,747,753,759,765,769,781,790,799,811,824,836,845,854,863,872,876,899,904,907,910],[10,11,13],"h1",{"id":12},"prerender-vs-prefetch-cost-trade-offs","Prerender vs Prefetch: Cost Trade-Offs",[15,16,17,18,23,24,28,29,33,34,37],"p",{},"This guide is part of ",[19,20,22],"a",{"href":21},"\u002Fnetwork-protocol-optimization\u002Fspeculative-loading-and-prefetching\u002F","Speculative Loading & Prefetching",", within ",[19,25,27],{"href":26},"\u002Fnetwork-protocol-optimization\u002F","Network & Server Response Optimization",". Prefetch and prerender sit at different points on a cost-benefit curve. ",[30,31,32],"strong",{},"Prefetching"," a document downloads its HTML ahead of time: one request, little bandwidth, no script execution. When the user navigates, TTFB disappears, but the page still has to load its subresources and render. ",[30,35,36],{},"Prerendering"," loads and renders the whole page in the background: all resources, all scripts, full layout. When the user navigates, the page appears almost instantly — but if they never navigate there, all that work was wasted, on the server and on the user's device.",[15,39,40],{},"The right choice depends on three factors: how likely the navigation is, how expensive the page is to load, and whether the page has side effects that make speculative execution unsafe. This guide gives a framework for deciding per link pattern and a method for tuning with real hit-rate data.",[15,42,43],{},[44,45,51,52,51,59,51,63,51,66,51,75,51,81,51,90,51,96,51,101,51,106,51,109,51,112,51,115,51,118,51,121,51,124,51,129,51,133,51,135,51,139,51,141,51,144,51,146,51,149,51,151,51],"svg",{"viewBox":46,"width":47,"role":48,"ariaLabel":49,"style":50},"0 0 760 228","100%","img","Comparison of the costs and benefits of prefetching and prerendering a document.","height:auto;max-width:760px;display:block;margin:1.75rem auto;font-family:inherit;color:var(--fp-svg-ink)"," ",[53,54],"rect",{"className":55,"x":57,"y":57,"width":47,"height":47,"fill":58},[56],"svg-canvas","0","#ffffff",[60,61,62],"title",{},"Prefetch vs prerender",[64,65,49],"desc",{},[53,67],{"x":68,"y":68,"width":69,"height":70,"rx":71,"fill":72,"stroke":73,"style":74},"1","758","226","10","none","currentColor","stroke-opacity:0.18",[76,77,62],"text",{"x":78,"y":79,"fill":73,"style":80},"28.0","34.0","font-size:16px;font-weight:700",[53,82],{"x":78,"y":83,"width":84,"height":85,"rx":86,"fill":87,"stroke":88,"style":89},"56.0","340.0","150.0","6","#ffc300","#b8860b","fill-opacity:0.24;stroke-opacity:0.9",[76,91,95],{"x":92,"y":93,"fill":73,"style":94},"42.0","82.0","font-size:14px;font-weight:700","Prefetch",[76,97,100],{"x":92,"y":98,"fill":73,"style":99},"108.0","font-size:12.5px;font-weight:700","•",[76,102,105],{"x":83,"y":98,"fill":73,"style":103,"textAnchor":104},"font-size:12.5px","start","Downloads the HTML only",[76,107,100],{"x":92,"y":108,"fill":73,"style":99},"132.0",[76,110,111],{"x":83,"y":108,"fill":73,"style":103,"textAnchor":104},"Saves TTFB on navigation",[76,113,100],{"x":92,"y":114,"fill":73,"style":99},"156.0",[76,116,117],{"x":83,"y":114,"fill":73,"style":103,"textAnchor":104},"Cheap if unused (one request)",[76,119,100],{"x":92,"y":120,"fill":73,"style":99},"180.0",[76,122,123],{"x":83,"y":120,"fill":73,"style":103,"textAnchor":104},"No scripts run; safe for most pages",[53,125],{"x":126,"y":83,"width":84,"height":85,"rx":86,"fill":127,"stroke":127,"style":128},"392.0","#0466c8","fill-opacity:0.14;stroke-opacity:0.9",[76,130,132],{"x":131,"y":93,"fill":73,"style":94},"406.0","Prerender",[76,134,100],{"x":131,"y":98,"fill":73,"style":99},[76,136,138],{"x":137,"y":98,"fill":73,"style":103,"textAnchor":104},"420.0","Loads and renders the whole page",[76,140,100],{"x":131,"y":108,"fill":73,"style":99},[76,142,143],{"x":137,"y":108,"fill":73,"style":103,"textAnchor":104},"Navigation is near-instant",[76,145,100],{"x":131,"y":114,"fill":73,"style":99},[76,147,148],{"x":137,"y":114,"fill":73,"style":103,"textAnchor":104},"Expensive if unused (full load)",[76,150,100],{"x":131,"y":120,"fill":73,"style":99},[76,152,153],{"x":137,"y":120,"fill":73,"style":103,"textAnchor":104},"Scripts run; must be prerender-safe",[155,156,158],"h2",{"id":157},"rapid-diagnosis","Rapid Diagnosis",[160,161,162,169,175,181],"ul",{},[163,164,165,168],"li",{},[30,166,167],{},"Check navigation probabilities"," from analytics for each link pattern.",[163,170,171,174],{},[30,172,173],{},"Check page weight",": bytes and main-thread time of target pages.",[163,176,177,180],{},[30,178,179],{},"Check server cost",": whether target pages are cached at the CDN.",[163,182,183,186],{},[30,184,185],{},"Check side effects",": anything that should only happen when a user really visits.",[155,188,190],{"id":189},"root-cause-analysis-where-speculation-goes-wrong","Root Cause Analysis: Where Speculation Goes Wrong",[15,192,193,196],{},[30,194,195],{},"1. Prerendering low-probability links."," Most prerenders wasted.",[15,198,199,202],{},[30,200,201],{},"2. Prerendering heavy pages."," Large CPU and memory costs on devices for uncertain benefit.",[15,204,205,208],{},[30,206,207],{},"3. Prefetching uncached, expensive pages."," Server load without CDN protection.",[15,210,211,214],{},[30,212,213],{},"4. Ignoring side effects."," Analytics, ad impressions, or state changes on unvisited pages.",[155,216,218],{"id":217},"step-by-step-resolution","Step-by-Step Resolution",[220,221,223],"h3",{"id":222},"_1-estimate-expected-value-per-pattern","1. Estimate expected value per pattern",[15,225,226],{},"For each link pattern, estimate the probability of navigation given the trigger (hover, visibility), the time saved (TTFB for prefetch; full LCP for prerender), and the cost if unused (bytes, server work, device CPU).",[228,229,234],"pre",{"className":230,"code":231,"language":232,"meta":233,"style":233},"language-javascript shiki shiki-themes github-light-high-contrast github-dark-high-contrast github-light-high-contrast","\u002F\u002F Rough expected-value comparison per link pattern.\nfunction speculationScore({ pClick, ttfbMs, lcpMs, pageKB, serverCostMs }) {\n  const prefetch = pClick * ttfbMs - (1 - pClick) * (serverCostMs * 0.1);\n  const prerender = pClick * lcpMs - (1 - pClick) * (pageKB * 0.5 + serverCostMs * 0.1);\n  return { prefetch: Math.round(prefetch), prerender: Math.round(prerender) };\n}\nspeculationScore({ pClick: 0.6, ttfbMs: 400, lcpMs: 1800, pageKB: 900, serverCostMs: 150 });\n\u002F\u002F trade-off: the weights are judgement calls (how much a wasted KB \"costs\");\n\u002F\u002F use them to rank patterns, not as precise economics.\n","javascript","",[235,236,237,246,289,338,387,407,413,452,458],"code",{"__ignoreMap":233},[238,239,242],"span",{"class":240,"line":241},"line",1,[238,243,245],{"class":244},"sjfSM","\u002F\u002F Rough expected-value comparison per link pattern.\n",[238,247,249,253,257,261,265,268,271,273,276,278,281,283,286],{"class":240,"line":248},2,[238,250,252],{"class":251},"sPARh","function",[238,254,256],{"class":255},"smZ65"," speculationScore",[238,258,260],{"class":259},"saISM","({ ",[238,262,264],{"class":263},"sQw3B","pClick",[238,266,267],{"class":259},", ",[238,269,270],{"class":263},"ttfbMs",[238,272,267],{"class":259},[238,274,275],{"class":263},"lcpMs",[238,277,267],{"class":259},[238,279,280],{"class":263},"pageKB",[238,282,267],{"class":259},[238,284,285],{"class":263},"serverCostMs",[238,287,288],{"class":259}," }) {\n",[238,290,292,295,299,302,305,308,311,314,317,319,322,325,327,330,332,335],{"class":240,"line":291},3,[238,293,294],{"class":251},"  const",[238,296,298],{"class":297},"sPXB4"," prefetch",[238,300,301],{"class":251}," =",[238,303,304],{"class":259}," pClick ",[238,306,307],{"class":251},"*",[238,309,310],{"class":259}," ttfbMs ",[238,312,313],{"class":251},"-",[238,315,316],{"class":259}," (",[238,318,68],{"class":297},[238,320,321],{"class":251}," -",[238,323,324],{"class":259}," pClick) ",[238,326,307],{"class":251},[238,328,329],{"class":259}," (serverCostMs ",[238,331,307],{"class":251},[238,333,334],{"class":297}," 0.1",[238,336,337],{"class":259},");\n",[238,339,341,343,346,348,350,352,355,357,359,361,363,365,367,370,372,375,378,381,383,385],{"class":240,"line":340},4,[238,342,294],{"class":251},[238,344,345],{"class":297}," prerender",[238,347,301],{"class":251},[238,349,304],{"class":259},[238,351,307],{"class":251},[238,353,354],{"class":259}," lcpMs ",[238,356,313],{"class":251},[238,358,316],{"class":259},[238,360,68],{"class":297},[238,362,321],{"class":251},[238,364,324],{"class":259},[238,366,307],{"class":251},[238,368,369],{"class":259}," (pageKB ",[238,371,307],{"class":251},[238,373,374],{"class":297}," 0.5",[238,376,377],{"class":251}," +",[238,379,380],{"class":259}," serverCostMs ",[238,382,307],{"class":251},[238,384,334],{"class":297},[238,386,337],{"class":259},[238,388,390,393,396,399,402,404],{"class":240,"line":389},5,[238,391,392],{"class":251},"  return",[238,394,395],{"class":259}," { prefetch: Math.",[238,397,398],{"class":255},"round",[238,400,401],{"class":259},"(prefetch), prerender: Math.",[238,403,398],{"class":255},[238,405,406],{"class":259},"(prerender) };\n",[238,408,410],{"class":240,"line":409},6,[238,411,412],{"class":259},"}\n",[238,414,416,419,422,425,428,431,434,437,440,443,446,449],{"class":240,"line":415},7,[238,417,418],{"class":255},"speculationScore",[238,420,421],{"class":259},"({ pClick: ",[238,423,424],{"class":297},"0.6",[238,426,427],{"class":259},", ttfbMs: ",[238,429,430],{"class":297},"400",[238,432,433],{"class":259},", lcpMs: ",[238,435,436],{"class":297},"1800",[238,438,439],{"class":259},", pageKB: ",[238,441,442],{"class":297},"900",[238,444,445],{"class":259},", serverCostMs: ",[238,447,448],{"class":297},"150",[238,450,451],{"class":259}," });\n",[238,453,455],{"class":240,"line":454},8,[238,456,457],{"class":244},"\u002F\u002F trade-off: the weights are judgement calls (how much a wasted KB \"costs\");\n",[238,459,461],{"class":240,"line":460},9,[238,462,463],{"class":244},"\u002F\u002F use them to rank patterns, not as precise economics.\n",[220,465,467],{"id":466},"_2-map-patterns-to-actions","2. Map patterns to actions",[15,469,470],{},"High probability and moderate weight → prerender (moderate eagerness). Medium probability → prefetch (moderate or conservative). Low probability or heavy pages → conservative prefetch or none. Side-effecting pages → never prerender.",[220,472,474],{"id":473},"_3-protect-the-server","3. Protect the server",[15,476,477,478,481],{},"Cache prefetched HTML at the CDN, and identify speculative requests by ",[235,479,480],{},"Sec-Purpose"," so they can be served from cache or shed under load.",[220,483,485],{"id":484},"_4-measure-hit-rates-and-adjust","4. Measure hit rates and adjust",[15,487,488,489,491,492,495],{},"Log speculation starts (server-side via ",[235,490,480],{},") and activations (client-side via ",[235,493,494],{},"activationStart","). Adjust eagerness and patterns where hit rates are low.",[15,497,498],{},[44,499,51,501,51,504,51,507,51,509,51,511,51,513,51,518,51,523,51,527,51,532,51,535,51,539,51,543,51,547,51,549,51,553,51,555,51,558,51,561,51,565,51,567,51,569,51,571,51,574,51,577,51,581,51,583,51,586,51,588,51,590,51,593,51,597,51,599,51,602,51,604,51],{"viewBox":46,"width":47,"role":48,"ariaLabel":500,"style":50},"Recommended speculation action for combinations of navigation probability and target page weight.",[53,502],{"className":503,"x":57,"y":57,"width":47,"height":47,"fill":58},[56],[60,505,506],{},"Choosing an action by probability and page weight",[64,508,500],{},[53,510],{"x":68,"y":68,"width":69,"height":70,"rx":71,"fill":72,"stroke":73,"style":74},[76,512,506],{"x":78,"y":79,"fill":73,"style":80},[53,514],{"x":78,"y":83,"width":515,"height":516,"rx":57,"fill":73,"stroke":73,"style":517},"145.0","30.0","fill-opacity:0.06;stroke-opacity:0.4",[76,519,522],{"x":520,"y":521,"fill":73,"style":99,"textAnchor":104},"38.0","75.5","Navigation probability",[53,524],{"x":525,"y":83,"width":526,"height":516,"rx":57,"fill":73,"stroke":73,"style":517},"173.0","279.5",[76,528,531],{"x":529,"y":521,"fill":73,"style":99,"textAnchor":530},"312.7","middle","Light page",[53,533],{"x":534,"y":83,"width":526,"height":516,"rx":57,"fill":73,"stroke":73,"style":517},"452.5",[76,536,538],{"x":537,"y":521,"fill":73,"style":99,"textAnchor":530},"592.2","Heavy page",[53,540],{"x":78,"y":541,"width":515,"height":516,"rx":57,"fill":72,"stroke":73,"style":542},"86.0","stroke-opacity:0.35",[76,544,546],{"x":520,"y":545,"fill":73,"style":99,"textAnchor":104},"105.5","High (over 50%)",[53,548],{"x":525,"y":541,"width":526,"height":516,"rx":57,"fill":127,"stroke":127,"style":128},[76,550,552],{"x":529,"y":545,"fill":73,"style":551,"textAnchor":530},"font-size:12px","prerender (moderate)",[53,554],{"x":534,"y":541,"width":526,"height":516,"rx":57,"fill":73,"stroke":73,"style":517},[76,556,557],{"x":537,"y":545,"fill":73,"style":551,"textAnchor":530},"prerender (conservative)",[53,559],{"x":78,"y":560,"width":515,"height":516,"rx":57,"fill":72,"stroke":73,"style":542},"116.0",[76,562,564],{"x":520,"y":563,"fill":73,"style":99,"textAnchor":104},"135.5","Medium (15-50%)",[53,566],{"x":525,"y":560,"width":526,"height":516,"rx":57,"fill":127,"stroke":127,"style":128},[76,568,557],{"x":529,"y":563,"fill":73,"style":551,"textAnchor":530},[53,570],{"x":534,"y":560,"width":526,"height":516,"rx":57,"fill":73,"stroke":73,"style":517},[76,572,573],{"x":537,"y":563,"fill":73,"style":551,"textAnchor":530},"prefetch (moderate)",[53,575],{"x":78,"y":576,"width":515,"height":516,"rx":57,"fill":72,"stroke":73,"style":542},"146.0",[76,578,580],{"x":520,"y":579,"fill":73,"style":99,"textAnchor":104},"165.5","Low (under 15%)",[53,582],{"x":525,"y":576,"width":526,"height":516,"rx":57,"fill":73,"stroke":73,"style":517},[76,584,585],{"x":529,"y":579,"fill":73,"style":551,"textAnchor":530},"prefetch (conservative)",[53,587],{"x":534,"y":576,"width":526,"height":516,"rx":57,"fill":87,"stroke":88,"style":89},[76,589,72],{"x":537,"y":579,"fill":73,"style":551,"textAnchor":530},[53,591],{"x":78,"y":592,"width":515,"height":516,"rx":57,"fill":72,"stroke":73,"style":542},"176.0",[76,594,596],{"x":520,"y":595,"fill":73,"style":99,"textAnchor":104},"195.5","Side effects on load",[53,598],{"x":525,"y":592,"width":526,"height":516,"rx":57,"fill":87,"stroke":88,"style":89},[76,600,601],{"x":529,"y":595,"fill":73,"style":551,"textAnchor":530},"prefetch at most",[53,603],{"x":534,"y":592,"width":526,"height":516,"rx":57,"fill":87,"stroke":88,"style":89},[76,605,72],{"x":537,"y":595,"fill":73,"style":551,"textAnchor":530},[155,607,609],{"id":608},"verification","Verification",[15,611,612,613,615],{},"Track per pattern: speculations started, activations, hit rate, and LCP for activated navigations versus non-speculated ones. Track server requests with ",[235,614,480],{}," and their cache hit ratio. Check device-side impact in lab tests: prerendering heavy pages on low-end devices should not degrade the current page's INP.",[155,617,619],{"id":618},"worked-example-an-e-commerce-category-page","Worked Example: An E-commerce Category Page",[15,621,622],{},"An e-commerce site prerendered every product link on category pages at moderate eagerness. Hit rate was 34%: users hovered over many products while browsing. Product pages were heavy (1.4MB, 600ms of main-thread work), and on mid-range Android devices, INP on category pages worsened by 40ms during browsing because of background prerenders. The team switched product links to conservative prerender (on pointer down) plus moderate prefetch, and kept moderate prerender only for \"next page\" pagination links (78% hit rate). Product navigation LCP was still much improved (prefetch removed TTFB; conservative prerender gave 100–200ms of lead time), category page INP returned to baseline, and wasted product prerenders fell by 80%.",[155,624,626],{"id":625},"prefetching-subresources","Prefetching Subresources",[15,628,629,630,633],{},"Document prefetch saves TTFB; the page's subresources still load after navigation. If the next page shares most assets with the current one (same CSS and JS bundles), they are already cached and the remaining cost is mainly images. For pages with different bundles, ",[235,631,632],{},"\u003Clink rel=\"prefetch\">"," for key route chunks (or framework route prefetching) can warm the cache for subresources too. Prerender handles all of this automatically, at higher cost.",[15,635,636],{},[44,637,51,640,51,643,51,646,51,648,51,651,51,653,51,660,51,667,51,672,51,676,51,681,51,685,51,688,51,693,51],{"viewBox":638,"width":47,"role":48,"ariaLabel":639,"style":50},"0 0 760 163","Bar chart comparing wasted data transfer per 100 hovers for different speculation configurations on product links.",[53,641],{"className":642,"x":57,"y":57,"width":47,"height":47,"fill":58},[56],[60,644,645],{},"Wasted work per 100 hovers on product links",[64,647,639],{},[53,649],{"x":68,"y":68,"width":69,"height":650,"rx":71,"fill":72,"stroke":73,"style":74},"161",[76,652,645],{"x":78,"y":79,"fill":73,"style":80},[76,654,659],{"x":655,"y":656,"fill":73,"style":657,"textAnchor":658},"164.2","70.0","font-size:13px","end","Moderate prerender",[53,661],{"x":662,"y":83,"width":663,"height":664,"rx":665,"fill":72,"stroke":73,"style":666},"176.2","491.8","19","3","fill-opacity:0.7;stroke-opacity:0.35",[76,668,671],{"x":669,"y":656,"fill":73,"style":670},"674.0","font-size:12px;font-weight:600","92MB",[76,673,675],{"x":655,"y":674,"fill":73,"style":657,"textAnchor":658},"101.0","Conservative prerender",[53,677],{"x":662,"y":678,"width":679,"height":664,"rx":665,"fill":127,"stroke":127,"style":680},"87.0","96.2","fill-opacity:0.55;stroke-opacity:0.9",[76,682,684],{"x":683,"y":674,"fill":73,"style":670},"278.4","18MB",[76,686,687],{"x":655,"y":108,"fill":73,"style":657,"textAnchor":658},"Moderate prefetch",[53,689],{"x":662,"y":690,"width":691,"height":664,"rx":665,"fill":87,"stroke":88,"style":692},"118.0","13.9","fill-opacity:0.7;stroke-opacity:0.9",[76,694,696],{"x":695,"y":108,"fill":73,"style":670},"196.1","2.6MB",[155,698,700],{"id":699},"tuning-with-real-data","Tuning With Real Data",[15,702,703,704,706],{},"Expected-value estimates are a starting point; real hit rates settle the question. Log each speculation start server-side (the ",[235,705,480],{}," header identifies prefetch and prerender requests) with the link pattern, and log activations client-side with the same pattern. A weekly report per pattern — starts, activations, hit rate, LCP saved — shows where to raise or lower eagerness. Patterns with prerender hit rates under about 30% are candidates for downgrading to prefetch; prefetch patterns with very high hit rates are candidates for upgrading to prerender. Revisit the report after major design changes, since link placement shifts click patterns.",[155,708,710],{"id":709},"common-mistakes","Common Mistakes",[160,712,713,719,725,731],{},[163,714,715,718],{},[30,716,717],{},"Prerendering everything at moderate eagerness on link-dense pages."," Many wasted prerenders.",[163,720,721,724],{},[30,722,723],{},"Ignoring device cost."," Background prerenders compete with the current page on low-end devices.",[163,726,727,730],{},[30,728,729],{},"Prefetching uncached dynamic pages."," Server load without benefit when hit rates are low.",[163,732,733,736],{},[30,734,735],{},"No per-pattern measurement."," One overall hit rate hides the bad patterns.",[155,738,740],{"id":739},"edge-cases","Edge Cases",[15,742,743,746],{},[30,744,745],{},"Pagination."," \"Next page\" links have high click probability and light pages — ideal prerender candidates.",[15,748,749,752],{},[30,750,751],{},"Search results."," The first result has high probability; prerender it immediately, prefetch the rest on hover.",[15,754,755,758],{},[30,756,757],{},"Logged-in dashboards."," Prerendering can show stale state; prefer prefetch.",[15,760,761,764],{},[30,762,763],{},"Large media pages."," Prerendering pages with autoplay video wastes bandwidth; video should wait for activation.",[155,766,768],{"id":767},"faq","FAQ",[770,771,774,778],"details",{"className":772},[773],"faq-item",[775,776,777],"summary",{},"Is prerender always better than prefetch?",[15,779,780],{},"It gives a better result when the user navigates, but costs much more when they do not. For low-probability or heavy pages, prefetch is the better trade-off.",[770,782,784,787],{"className":783},[773],[775,785,786],{},"What hit rate is good?",[15,788,789],{},"For prerender, above about 50% is good. For prefetch, lower hit rates are acceptable because each one is cheap.",[770,791,793,796],{"className":792},[773],[775,794,795],{},"Does prerendering affect the current page's performance?",[15,797,798],{},"It can on low-end devices, since prerenders use CPU and memory. Browsers limit concurrency, but heavy pages at aggressive eagerness can still affect INP.",[770,800,802,805],{"className":801},[773],[775,803,804],{},"Can the server reject speculative requests?",[15,806,807,808,810],{},"Yes. Speculative requests carry ",[235,809,480],{},", and the server can return an error (the speculation is discarded) under heavy load.",[770,812,814,817],{"className":813},[773],[775,815,816],{},"Does prefetch include subresources?",[15,818,819,820,823],{},"Speculation rules prefetch only the document. Use ",[235,821,822],{},"rel=prefetch"," or framework route prefetching for key subresources if needed.",[770,825,827,830],{"className":826},[773],[775,828,829],{},"How do I measure wasted speculation?",[15,831,832,833,835],{},"Count speculative requests server-side (via ",[235,834,480],{},") and compare with activations reported client-side.",[770,837,839,842],{"className":838},[773],[775,840,841],{},"Should mobile users get less speculation?",[15,843,844],{},"Browsers already scale back under data saver and memory pressure. Conservative eagerness on heavy pages is a good default for mobile-heavy audiences.",[770,846,848,851],{"className":847},[773],[775,849,850],{},"Can I prerender pages with ads?",[15,852,853],{},"Ad impressions must not be counted before activation. Many ad libraries handle prerendering; otherwise, defer ad loading until activation.",[770,855,857,860],{"className":856},[773],[775,858,859],{},"Is prefetching safe for pages behind login?",[15,861,862],{},"Generally yes, since no scripts run and the request carries the user's cookies like a normal navigation. Avoid URLs that change state on GET.",[770,864,866,869],{"className":865},[773],[775,867,868],{},"Does prerendering count against crawl budgets?",[15,870,871],{},"No. Speculation happens in users' browsers, not in search crawlers.",[155,873,875],{"id":874},"related","Related",[160,877,878,885,892],{},[163,879,880,884],{},[19,881,883],{"href":882},"\u002Fnetwork-protocol-optimization\u002Fspeculative-loading-and-prefetching\u002Fspeculation-rules-for-instant-navigations\u002F","Speculation rules for instant navigations"," — writing the rules.",[163,886,887,891],{},[19,888,890],{"href":889},"\u002Fnetwork-protocol-optimization\u002Fspeculative-loading-and-prefetching\u002Fviewport-prefetching-with-quicklink\u002F","Viewport prefetching with Quicklink"," — idle-time prefetching.",[163,893,894,898],{},[19,895,897],{"href":896},"\u002Fadvanced-caching-strategies-cdn-architecture\u002Fcdn-edge-caching-configuration\u002Fcaching-api-responses-at-the-cdn\u002F","Caching API responses at the CDN"," — protecting the server from speculative load.",[900,901,903],"script",{"type":902},"application\u002Fld+json","\n{\n  \"@context\": \"https:\u002F\u002Fschema.org\",\n  \"@type\": \"HowTo\",\n  \"name\": \"Prerender vs Prefetch: Cost Trade-Offs\",\n  \"description\": \"A cost-benefit framework for choosing between prefetching and prerendering for different kinds of links, based on probability, page weight and side effects.\",\n  \"step\": [\n    {\n      \"@type\": \"HowToStep\",\n      \"position\": 1,\n      \"name\": \"Estimate expected value per pattern\",\n      \"text\": \"For each link pattern, estimate the probability of navigation given the trigger (hover, visibility), the time saved (TTFB for prefetch; full LCP for prerender), and the cost if unused (bytes, server work, device CPU).\"\n    },\n    {\n      \"@type\": \"HowToStep\",\n      \"position\": 2,\n      \"name\": \"Map patterns to actions\",\n      \"text\": \"High probability and moderate weight → prerender (moderate eagerness).\"\n    },\n    {\n      \"@type\": \"HowToStep\",\n      \"position\": 3,\n      \"name\": \"Protect the server\",\n      \"text\": \"Cache prefetched HTML at the CDN, and identify speculative requests by Sec-Purpose so they can be served from cache or shed under load.\"\n    },\n    {\n      \"@type\": \"HowToStep\",\n      \"position\": 4,\n      \"name\": \"Measure hit rates and adjust\",\n      \"text\": \"Log speculation starts (server-side via Sec-Purpose) and activations (client-side via activationStart).\"\n    }\n  ]\n}\n",[900,905,906],{"type":902},"\n{\n  \"@context\": \"https:\u002F\u002Fschema.org\",\n  \"@type\": \"TechArticle\",\n  \"headline\": \"Prerender vs Prefetch: Cost Trade-Offs\",\n  \"description\": \"A cost-benefit framework for choosing between prefetching and prerendering for different kinds of links, based on probability, page weight and side effects.\",\n  \"datePublished\": \"2026-10-06\",\n  \"dateModified\": \"2026-10-06\",\n  \"author\": {\n    \"@type\": \"Organization\",\n    \"name\": \"frontend-performance.com\"\n  },\n  \"publisher\": {\n    \"@type\": \"Organization\",\n    \"name\": \"frontend-performance.com\"\n  },\n  \"mainEntityOfPage\": {\n    \"@type\": \"WebPage\",\n    \"@id\": \"https:\u002F\u002Ffrontend-performance.com\u002Fnetwork-protocol-optimization\u002Fspeculative-loading-and-prefetching\u002Fprerender-vs-prefetch-cost-trade-offs\u002F\"\n  }\n}\n",[900,908,909],{"type":902},"\n{\n  \"@context\": \"https:\u002F\u002Fschema.org\",\n  \"@type\": \"BreadcrumbList\",\n  \"itemListElement\": [\n    {\n      \"@type\": \"ListItem\",\n      \"position\": 1,\n      \"name\": \"Home\",\n      \"item\": \"https:\u002F\u002Ffrontend-performance.com\u002F\"\n    },\n    {\n      \"@type\": \"ListItem\",\n      \"position\": 2,\n      \"name\": \"Network & Server Response Optimization\",\n      \"item\": \"https:\u002F\u002Ffrontend-performance.com\u002Fnetwork-protocol-optimization\u002F\"\n    },\n    {\n      \"@type\": \"ListItem\",\n      \"position\": 3,\n      \"name\": \"Speculative Loading & Prefetching\",\n      \"item\": \"https:\u002F\u002Ffrontend-performance.com\u002Fnetwork-protocol-optimization\u002Fspeculative-loading-and-prefetching\u002F\"\n    },\n    {\n      \"@type\": \"ListItem\",\n      \"position\": 4,\n      \"name\": \"Prerender vs Prefetch Cost Trade-Offs\",\n      \"item\": \"https:\u002F\u002Ffrontend-performance.com\u002Fnetwork-protocol-optimization\u002Fspeculative-loading-and-prefetching\u002Fprerender-vs-prefetch-cost-trade-offs\u002F\"\n    }\n  ]\n}\n",[911,912,913],"style",{},"html pre.shiki code .sjfSM, html code.shiki .sjfSM{--shiki-default:#66707B;--shiki-dark:#BDC4CC;--shiki-light:#66707B}html pre.shiki code .sPARh, html code.shiki .sPARh{--shiki-default:#A0111F;--shiki-dark:#FF9492;--shiki-light:#A0111F}html pre.shiki code .smZ65, html code.shiki .smZ65{--shiki-default:#622CBC;--shiki-dark:#DBB7FF;--shiki-light:#622CBC}html pre.shiki code .saISM, html code.shiki .saISM{--shiki-default:#0E1116;--shiki-dark:#F0F3F6;--shiki-light:#0E1116}html pre.shiki code .sQw3B, html code.shiki .sQw3B{--shiki-default:#702C00;--shiki-dark:#FFB757;--shiki-light:#702C00}html pre.shiki code .sPXB4, html code.shiki .sPXB4{--shiki-default:#023B95;--shiki-dark:#91CBFF;--shiki-light:#023B95}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}",{"title":233,"searchDepth":248,"depth":248,"links":915},[916,917,918,924,925,926,927,928,929,930,931],{"id":157,"depth":248,"text":158},{"id":189,"depth":248,"text":190},{"id":217,"depth":248,"text":218,"children":919},[920,921,922,923],{"id":222,"depth":291,"text":223},{"id":466,"depth":291,"text":467},{"id":473,"depth":291,"text":474},{"id":484,"depth":291,"text":485},{"id":608,"depth":248,"text":609},{"id":618,"depth":248,"text":619},{"id":625,"depth":248,"text":626},{"id":699,"depth":248,"text":700},{"id":709,"depth":248,"text":710},{"id":739,"depth":248,"text":740},{"id":767,"depth":248,"text":768},{"id":874,"depth":248,"text":875},"A cost-benefit framework for choosing between prefetching and prerendering for different kinds of links, based on probability, page weight and side effects.","md",{"slug":12,"type":935,"breadcrumb":936,"datePublished":944,"dateModified":944},"article",[937,940,941,942],{"name":938,"url":939},"Home","\u002F",{"name":27,"url":26},{"name":22,"url":21},{"name":5,"url":943},"\u002Fnetwork-protocol-optimization\u002Fspeculative-loading-and-prefetching\u002Fprerender-vs-prefetch-cost-trade-offs\u002F","2026-10-06",true,"\u002Fnetwork-protocol-optimization\u002Fspeculative-loading-and-prefetching\u002Fprerender-vs-prefetch-cost-trade-offs",{"title":948,"description":949},"Prerender vs Prefetch: Costs, Benefits and Trade-Offs","Prefetch saves TTFB for one request; prerender makes navigations instant at the cost of CPU, memory and side effects. Choose per link pattern with hit-rate data.","network-protocol-optimization\u002Fspeculative-loading-and-prefetching\u002Fprerender-vs-prefetch-cost-trade-offs\u002Findex","NTjQbxJX6RbInDpCA34VJrz2KJmY8HZDhrN-6Qglm5E",[953,957],{"title":954,"path":955,"stem":956,"children":-1},"Avoiding Analytics Double Counting on Prerender","\u002Fnetwork-protocol-optimization\u002Fspeculative-loading-and-prefetching\u002Favoiding-analytics-double-counting-on-prerender","network-protocol-optimization\u002Fspeculative-loading-and-prefetching\u002Favoiding-analytics-double-counting-on-prerender\u002Findex",{"title":958,"path":959,"stem":960,"children":-1},"Speculation Rules for Instant Navigations","\u002Fnetwork-protocol-optimization\u002Fspeculative-loading-and-prefetching\u002Fspeculation-rules-for-instant-navigations","network-protocol-optimization\u002Fspeculative-loading-and-prefetching\u002Fspeculation-rules-for-instant-navigations\u002Findex",1791308073075]