[{"data":1,"prerenderedAt":895},["ShallowReactive",2],{"content:\u002Fnetwork-protocol-optimization\u002Fhttp2-http3-and-connection-management\u002Fwhy-domain-sharding-hurts-on-http2":3,"surroundings:\u002Fnetwork-protocol-optimization\u002Fhttp2-http3-and-connection-management\u002Fwhy-domain-sharding-hurts-on-http2":886},{"id":4,"title":5,"body":6,"description":866,"extension":867,"meta":868,"navigation":879,"path":880,"seo":881,"stem":884,"__hash__":885},"content\u002Fnetwork-protocol-optimization\u002Fhttp2-http3-and-connection-management\u002Fwhy-domain-sharding-hurts-on-http2\u002Findex.md","Why Domain Sharding Hurts on HTTP\u002F2",{"type":7,"value":8,"toc":848},"minimark",[9,13,37,40,153,158,187,191,197,203,209,215,219,224,407,411,414,418,421,425,428,496,500,503,507,522,638,642,645,649,652,656,682,686,692,698,704,710,714,726,735,744,753,762,771,780,789,798,807,811,833,838,841,844],[10,11,5],"h1",{"id":12},"why-domain-sharding-hurts-on-http2",[14,15,16,17,22,23,27,28,32,33,36],"p",{},"This guide is part of ",[18,19,21],"a",{"href":20},"\u002Fnetwork-protocol-optimization\u002Fhttp2-http3-and-connection-management\u002F","HTTP\u002F2, HTTP\u002F3 & Connection Management",", within ",[18,24,26],{"href":25},"\u002Fnetwork-protocol-optimization\u002F","Network & Server Response Optimization",". Domain sharding was a standard HTTP\u002F1.1 technique: because browsers limited connections per hostname (typically six), sites split assets across ",[29,30,31],"code",{},"static1.example.com",", ",[29,34,35],{},"static2.example.com"," and so on to download more files in parallel. With HTTP\u002F2 and HTTP\u002F3, a single connection carries many concurrent requests, so sharding no longer adds parallelism. It only adds costs: a DNS lookup, TCP and TLS handshakes for each extra hostname, a new connection in slow start, and responses split across connections that the server cannot prioritise together.",[14,38,39],{},"Many sites still shard — through old CDN configurations, CMS plugins, or image services that rotate hostnames. Removing sharding is usually straightforward, but needs care with cached URLs, hard-coded references and cookies.",[14,41,42],{},[43,44,50,51,50,58,50,62,50,65,50,74,50,80,50,89,50,95,50,100,50,105,50,108,50,111,50,114,50,117,50,120,50,123,50,128,50,132,50,134,50,138,50,140,50,143,50,145,50,148,50,150,50],"svg",{"viewBox":45,"width":46,"role":47,"ariaLabel":48,"style":49},"0 0 760 228","100%","img","Comparison of serving assets from several sharded hostnames versus one consolidated hostname over HTTP\u002F2.","height:auto;max-width:760px;display:block;margin:1.75rem auto;font-family:inherit;color:var(--fp-svg-ink)"," ",[52,53],"rect",{"className":54,"x":56,"y":56,"width":46,"height":46,"fill":57},[55],"svg-canvas","0","#ffffff",[59,60,61],"title",{},"Sharded vs consolidated assets on HTTP\u002F2",[63,64,48],"desc",{},[52,66],{"x":67,"y":67,"width":68,"height":69,"rx":70,"fill":71,"stroke":72,"style":73},"1","758","226","10","none","currentColor","stroke-opacity:0.18",[75,76,61],"text",{"x":77,"y":78,"fill":72,"style":79},"28.0","34.0","font-size:16px;font-weight:700",[52,81],{"x":77,"y":82,"width":83,"height":84,"rx":85,"fill":86,"stroke":87,"style":88},"56.0","340.0","150.0","6","#ffc300","#b8860b","fill-opacity:0.24;stroke-opacity:0.9",[75,90,94],{"x":91,"y":92,"fill":72,"style":93},"42.0","82.0","font-size:14px;font-weight:700","4 shard hostnames",[75,96,99],{"x":91,"y":97,"fill":72,"style":98},"108.0","font-size:12.5px;font-weight:700","•",[75,101,104],{"x":82,"y":97,"fill":72,"style":102,"textAnchor":103},"font-size:12.5px","start","4 DNS lookups and 4 TLS handshakes",[75,106,99],{"x":91,"y":107,"fill":72,"style":98},"132.0",[75,109,110],{"x":82,"y":107,"fill":72,"style":102,"textAnchor":103},"4 connections in TCP slow start",[75,112,99],{"x":91,"y":113,"fill":72,"style":98},"156.0",[75,115,116],{"x":82,"y":113,"fill":72,"style":102,"textAnchor":103},"Priorities split across connections",[75,118,99],{"x":91,"y":119,"fill":72,"style":98},"180.0",[75,121,122],{"x":82,"y":119,"fill":72,"style":102,"textAnchor":103},"Critical CSS competes with images elsewhere",[52,124],{"x":125,"y":82,"width":83,"height":84,"rx":85,"fill":126,"stroke":126,"style":127},"392.0","#0466c8","fill-opacity:0.14;stroke-opacity:0.9",[75,129,131],{"x":130,"y":92,"fill":72,"style":93},"406.0","1 consolidated hostname",[75,133,99],{"x":130,"y":97,"fill":72,"style":98},[75,135,137],{"x":136,"y":97,"fill":72,"style":102,"textAnchor":103},"420.0","1 DNS lookup and 1 handshake",[75,139,99],{"x":130,"y":107,"fill":72,"style":98},[75,141,142],{"x":136,"y":107,"fill":72,"style":102,"textAnchor":103},"One warm, growing connection",[75,144,99],{"x":130,"y":113,"fill":72,"style":98},[75,146,147],{"x":136,"y":113,"fill":72,"style":102,"textAnchor":103},"Server prioritises all streams together",[75,149,99],{"x":130,"y":119,"fill":72,"style":98},[75,151,152],{"x":136,"y":119,"fill":72,"style":102,"textAnchor":103},"Critical resources first",[154,155,157],"h2",{"id":156},"rapid-diagnosis","Rapid Diagnosis",[159,160,161,169,175,181],"ul",{},[162,163,164,168],"li",{},[165,166,167],"strong",{},"List asset hostnames"," in the Network panel (group by domain); multiple similar hostnames indicate sharding.",[162,170,171,174],{},[165,172,173],{},"Check connection timing",": each shard shows its own DNS, connect and TLS segments.",[162,176,177,180],{},[165,178,179],{},"Check the protocol",": sharding on HTTP\u002F2 or HTTP\u002F3 is almost always harmful.",[162,182,183,186],{},[165,184,185],{},"Check whether coalescing happens",": if shards share an IP and certificate, Chrome may reuse one connection (shown by the same Connection ID column).",[154,188,190],{"id":189},"root-cause-analysis","Root Cause Analysis",[14,192,193,196],{},[165,194,195],{},"1. Legacy configuration."," Sharding set up years ago for HTTP\u002F1.1.",[14,198,199,202],{},[165,200,201],{},"2. CMS or plugin defaults."," Some image or asset plugins rotate hostnames automatically.",[14,204,205,208],{},[165,206,207],{},"3. Cookie-free domains."," Separate asset domains were also used to avoid sending cookies; HTTP\u002F2 header compression makes cookie overhead much smaller.",[14,210,211,214],{},[165,212,213],{},"4. Different certificates or IPs."," Prevent coalescing, so each shard really costs a new connection.",[154,216,218],{"id":217},"step-by-step-resolution","Step-by-Step Resolution",[220,221,223],"h3",{"id":222},"_1-measure-the-cost","1. Measure the cost",[225,226,231],"pre",{"className":227,"code":228,"language":229,"meta":230,"style":230},"language-javascript shiki shiki-themes github-light-high-contrast github-dark-high-contrast github-light-high-contrast","\u002F\u002F Console: connection setup time per asset hostname.\nconst hosts = {};\nfor (const r of performance.getEntriesByType('resource')) {\n  const h = new URL(r.name).host;\n  const setup = r.connectEnd - r.domainLookupStart;\n  if (setup > 0) hosts[h] = Math.max(hosts[h] || 0, Math.round(setup));\n}\nconsole.table(hosts);\n\u002F\u002F trade-off: reused or coalesced connections report 0 setup time, which is exactly\n\u002F\u002F what consolidation should achieve; cross-origin entries need Timing-Allow-Origin.\n","javascript","",[29,232,233,242,260,294,314,333,377,383,395,401],{"__ignoreMap":230},[234,235,238],"span",{"class":236,"line":237},"line",1,[234,239,241],{"class":240},"sjfSM","\u002F\u002F Console: connection setup time per asset hostname.\n",[234,243,245,249,253,256],{"class":236,"line":244},2,[234,246,248],{"class":247},"sPARh","const",[234,250,252],{"class":251},"sPXB4"," hosts",[234,254,255],{"class":247}," =",[234,257,259],{"class":258},"saISM"," {};\n",[234,261,263,266,269,271,274,277,280,284,287,291],{"class":236,"line":262},3,[234,264,265],{"class":247},"for",[234,267,268],{"class":258}," (",[234,270,248],{"class":247},[234,272,273],{"class":251}," r",[234,275,276],{"class":247}," of",[234,278,279],{"class":258}," performance.",[234,281,283],{"class":282},"smZ65","getEntriesByType",[234,285,286],{"class":258},"(",[234,288,290],{"class":289},"sZ8jY","'resource'",[234,292,293],{"class":258},")) {\n",[234,295,297,300,303,305,308,311],{"class":236,"line":296},4,[234,298,299],{"class":247},"  const",[234,301,302],{"class":251}," h",[234,304,255],{"class":247},[234,306,307],{"class":247}," new",[234,309,310],{"class":282}," URL",[234,312,313],{"class":258},"(r.name).host;\n",[234,315,317,319,322,324,327,330],{"class":236,"line":316},5,[234,318,299],{"class":247},[234,320,321],{"class":251}," setup",[234,323,255],{"class":247},[234,325,326],{"class":258}," r.connectEnd ",[234,328,329],{"class":247},"-",[234,331,332],{"class":258}," r.domainLookupStart;\n",[234,334,336,339,342,345,348,351,354,357,360,363,366,368,371,374],{"class":236,"line":335},6,[234,337,338],{"class":247},"  if",[234,340,341],{"class":258}," (setup ",[234,343,344],{"class":247},">",[234,346,347],{"class":251}," 0",[234,349,350],{"class":258},") hosts[h] ",[234,352,353],{"class":247},"=",[234,355,356],{"class":258}," Math.",[234,358,359],{"class":282},"max",[234,361,362],{"class":258},"(hosts[h] ",[234,364,365],{"class":247},"||",[234,367,347],{"class":251},[234,369,370],{"class":258},", Math.",[234,372,373],{"class":282},"round",[234,375,376],{"class":258},"(setup));\n",[234,378,380],{"class":236,"line":379},7,[234,381,382],{"class":258},"}\n",[234,384,386,389,392],{"class":236,"line":385},8,[234,387,388],{"class":258},"console.",[234,390,391],{"class":282},"table",[234,393,394],{"class":258},"(hosts);\n",[234,396,398],{"class":236,"line":397},9,[234,399,400],{"class":240},"\u002F\u002F trade-off: reused or coalesced connections report 0 setup time, which is exactly\n",[234,402,404],{"class":236,"line":403},10,[234,405,406],{"class":240},"\u002F\u002F what consolidation should achieve; cross-origin entries need Timing-Allow-Origin.\n",[220,408,410],{"id":409},"_2-consolidate-onto-one-hostname","2. Consolidate onto one hostname",[14,412,413],{},"Serve all static assets from the main origin (through the CDN) or from a single asset hostname. Update templates, CSS and build configuration to emit the new URLs.",[220,415,417],{"id":416},"_3-redirect-or-keep-old-shard-hostnames-working","3. Redirect or keep old shard hostnames working",[14,419,420],{},"Keep old hostnames serving the same files (or redirecting) for cached HTML and external references, but stop generating new references to them.",[220,422,424],{"id":423},"_4-if-shards-must-remain-enable-coalescing","4. If shards must remain, enable coalescing",[14,426,427],{},"When separate hostnames cannot be removed quickly, serve them from the same IP addresses with a certificate covering all names, so browsers can coalesce them onto one connection.",[14,429,430],{},[43,431,50,434,50,437,50,440,50,442,50,445,50,447,50,454,50,461,50,466,50,470,50,475,50,479,50,482,50,487,50,491,50],{"viewBox":432,"width":46,"role":47,"ariaLabel":433,"style":49},"0 0 760 189","Bar chart of total connection setup time spent before LCP with sharded and consolidated asset hostnames.",[52,435],{"className":436,"x":56,"y":56,"width":46,"height":46,"fill":57},[55],[59,438,439],{},"Connection setup before LCP (mobile, 120ms RTT)",[63,441,433],{},[52,443],{"x":67,"y":67,"width":68,"height":444,"rx":70,"fill":71,"stroke":72,"style":73},"187",[75,446,439],{"x":77,"y":78,"fill":72,"style":79},[75,448,453],{"x":449,"y":450,"fill":72,"style":451,"textAnchor":452},"169.2","70.0","font-size:13px","end","4 shards (no coalescing)",[52,455],{"x":456,"y":82,"width":457,"height":458,"rx":459,"fill":71,"stroke":72,"style":460},"181.2","486.9","19","3","fill-opacity:0.7;stroke-opacity:0.35",[75,462,465],{"x":463,"y":450,"fill":72,"style":464},"674.0","font-size:12px;font-weight:600","1150ms",[75,467,469],{"x":449,"y":468,"fill":72,"style":451,"textAnchor":452},"101.0","4 shards (coalesced)",[52,471],{"x":456,"y":472,"width":473,"height":458,"rx":459,"fill":126,"stroke":126,"style":474},"87.0","139.7","fill-opacity:0.55;stroke-opacity:0.9",[75,476,478],{"x":477,"y":468,"fill":72,"style":464},"326.9","330ms",[75,480,481],{"x":449,"y":107,"fill":72,"style":451,"textAnchor":452},"1 hostname",[52,483],{"x":456,"y":484,"width":485,"height":458,"rx":459,"fill":86,"stroke":87,"style":486},"118.0","127.0","fill-opacity:0.7;stroke-opacity:0.9",[75,488,490],{"x":489,"y":107,"fill":72,"style":464},"314.2","300ms",[75,492,495],{"x":77,"y":493,"fill":494,"style":102},"167.0","#51617a","Sum of DNS, TCP and TLS setup across connections; some overlap in practice.",[154,497,499],{"id":498},"verification","Verification",[14,501,502],{},"The Network panel should show assets coming from one hostname with a single connection (Connection ID column identical). Connection setup segments for asset requests should disappear after the first. In RUM, compare LCP and resource load delay for critical CSS and images before and after.",[154,504,506],{"id":505},"worked-example-an-online-classifieds-site","Worked Example: An Online Classifieds Site",[14,508,509,510,513,514,517,518,521],{},"A classifieds site served listing photos from ",[29,511,512],{},"img1"," to ",[29,515,516],{},"img4.example-static.com",", a scheme introduced in 2013. After moving to HTTP\u002F2, each listing page opened five connections (main plus four shards), each with separate certificates. On mobile, listing pages spent about 900ms in connection setup before the first photo started downloading, and the LCP photo often waited behind thumbnails on other shards. Consolidating to ",[29,519,520],{},"static.example.com"," served via the same CDN as the main site, with one certificate covering both names, reduced connections to one (coalesced). LCP p75 improved by 520ms on mobile. Old shard hostnames kept serving files for six months for cached pages and external links.",[14,523,524],{},[43,525,50,528,50,531,50,534,50,536,50,553,50,556,50,558,50,562,50,569,50,574,50,577,50,581,50,584,50,587,50,591,50,594,50,597,50,601,50,604,50,607,50,611,50,614,50,618,50,626,50,630,50,634,50],{"viewBox":526,"width":46,"role":47,"ariaLabel":527,"style":49},"0 0 760 149","Steps to remove domain sharding without breaking existing references.",[52,529],{"className":530,"x":56,"y":56,"width":46,"height":46,"fill":57},[55],[59,532,533],{},"Safe consolidation of shard hostnames",[63,535,527],{},[537,538,539],"defs",{},[540,541,548],"marker",{"id":542,"viewBox":543,"refX":544,"refY":545,"markerWidth":546,"markerHeight":546,"orient":547},"fa003d4b88","0 0 10 10","9","5","7","auto-start-reverse",[549,550],"path",{"d":551,"fill":72,"style":552},"M0 0 L10 5 L0 10 z","fill-opacity:0.7",[52,554],{"x":67,"y":67,"width":68,"height":555,"rx":70,"fill":71,"stroke":72,"style":73},"147",[75,557,533],{"x":77,"y":78,"fill":72,"style":79},[52,559],{"x":77,"y":82,"width":560,"height":561,"rx":85,"fill":126,"stroke":126,"style":127},"108.8","71.0",[75,563,568],{"x":564,"y":565,"fill":72,"style":566,"textAnchor":567},"82.4","78.0","font-size:13px;font-weight:700","middle","Inventory",[75,570,573],{"x":564,"y":571,"fill":72,"style":572,"textAnchor":567},"96.0","font-size:12px","shard hostnames",[52,575],{"x":576,"y":82,"width":560,"height":561,"rx":85,"fill":126,"stroke":126,"style":127},"176.8",[75,578,580],{"x":579,"y":565,"fill":72,"style":566,"textAnchor":567},"231.2","Single host",[75,582,583],{"x":579,"y":571,"fill":72,"style":572,"textAnchor":567},"CDN property",[52,585],{"x":586,"y":82,"width":560,"height":561,"rx":85,"fill":86,"stroke":87,"style":88},"325.6",[75,588,590],{"x":589,"y":565,"fill":72,"style":566,"textAnchor":567},"380.0","Update refs",[75,592,593],{"x":589,"y":571,"fill":72,"style":572,"textAnchor":567},"templates + CSS",[52,595],{"x":596,"y":82,"width":560,"height":561,"rx":85,"fill":126,"stroke":126,"style":127},"474.4",[75,598,600],{"x":599,"y":565,"fill":72,"style":566,"textAnchor":567},"528.8","Keep old hosts",[75,602,603],{"x":599,"y":571,"fill":72,"style":572,"textAnchor":567},"serve or redirect",[52,605],{"x":606,"y":82,"width":560,"height":561,"rx":85,"fill":126,"stroke":126,"style":127},"623.2",[75,608,610],{"x":609,"y":565,"fill":72,"style":566,"textAnchor":567},"677.6","Retire",[75,612,613],{"x":609,"y":571,"fill":72,"style":572,"textAnchor":567},"when traffic is",[75,615,617],{"x":609,"y":616,"fill":72,"style":572,"textAnchor":567},"112.0","gone",[236,619],{"x1":620,"y1":621,"x2":622,"y2":621,"stroke":72,"strokeWidth":623,"style":624,"markerEnd":625},"136.8","91.5","174.8","1.5","stroke-opacity:0.6","url(#fa003d4b88)",[236,627],{"x1":628,"y1":621,"x2":629,"y2":621,"stroke":72,"strokeWidth":623,"style":624,"markerEnd":625},"285.6","323.6",[236,631],{"x1":632,"y1":621,"x2":633,"y2":621,"stroke":72,"strokeWidth":623,"style":624,"markerEnd":625},"434.4","472.4",[236,635],{"x1":636,"y1":621,"x2":637,"y2":621,"stroke":72,"strokeWidth":623,"style":624,"markerEnd":625},"583.2","621.2",[154,639,641],{"id":640},"cookie-free-domains-revisited","Cookie-Free Domains Revisited",[14,643,644],{},"A secondary reason for separate asset domains was avoiding cookies on every asset request. HTTP\u002F2's HPACK and HTTP\u002F3's QPACK header compression mean repeated cookies on the same connection cost only a few bytes after the first request. The remaining reasons for a separate asset domain are organisational (separate infrastructure, security isolation for user uploads) rather than performance. For user-generated content, a separate domain is still a good security practice; serve it through the same CDN with coalescing where possible, or accept one extra connection.",[154,646,648],{"id":647},"migrating-without-breaking-caches","Migrating Without Breaking Caches",[14,650,651],{},"Changing asset hostnames changes every asset URL, which invalidates browser and CDN caches for those files once. Plan the switch for a normal deploy (assets are re-downloaded at their new URLs) and avoid combining it with other large changes, so the one-off cost is easy to recognise in monitoring. Update the service worker's caching rules if it caches by hostname. Search the codebase, CMS content and email templates for hard-coded shard URLs; content editors often paste absolute image URLs that a template change will not catch.",[154,653,655],{"id":654},"common-mistakes","Common Mistakes",[159,657,658,664,670,676],{},[162,659,660,663],{},[165,661,662],{},"Consolidating without updating CSS references."," Background images and fonts in CSS still point at old shards.",[162,665,666,669],{},[165,667,668],{},"Removing old hostnames abruptly."," Cached HTML and external links break.",[162,671,672,675],{},[165,673,674],{},"Assuming coalescing works."," Different IPs or certificates prevent it.",[162,677,678,681],{},[165,679,680],{},"Keeping sharding for \"parallelism\"."," HTTP\u002F2 already multiplexes.",[154,683,685],{"id":684},"edge-cases","Edge Cases",[14,687,688,691],{},[165,689,690],{},"HTTP\u002F1.1 clients."," A small share of clients and bots still use HTTP\u002F1.1; they are not worth optimising for at the expense of everyone else.",[14,693,694,697],{},[165,695,696],{},"Third-party CDNs for libraries."," Public CDNs for libraries add a connection and no longer share cache across sites (cache partitioning); self-host instead.",[14,699,700,703],{},[165,701,702],{},"Separate image CDNs."," An image CDN on its own hostname is a legitimate extra origin; preconnect to it and keep it to one hostname.",[14,705,706,709],{},[165,707,708],{},"Service workers."," Sharded hostnames complicate service worker caching rules; consolidation simplifies them.",[154,711,713],{"id":712},"faq","FAQ",[715,716,719,723],"details",{"className":717},[718],"faq-item",[720,721,722],"summary",{},"Is domain sharding ever useful today?",[14,724,725],{},"Rarely. For HTTP\u002F1.1-only clients it can help, but those are a tiny share of traffic. On HTTP\u002F2 and HTTP\u002F3 it hurts.",[715,727,729,732],{"className":728},[718],[720,730,731],{},"Does connection coalescing make sharding harmless?",[14,733,734],{},"Mostly, if all shards resolve to the same IP and share a certificate. But it is simpler and more reliable to consolidate.",[715,736,738,741],{"className":737},[718],[720,739,740],{},"Should I keep a separate cookie-free domain?",[14,742,743],{},"For performance, no longer necessary. For security isolation of user uploads, a separate domain is still sensible.",[715,745,747,750],{"className":746},[718],[720,748,749],{},"How do I find sharded hostnames?",[14,751,752],{},"Group requests by domain in DevTools or list resource origins with the Resource Timing API.",[715,754,756,759],{"className":755},[718],[720,757,758],{},"Will consolidating hurt parallel downloads?",[14,760,761],{},"No. HTTP\u002F2 and HTTP\u002F3 download many resources concurrently over one connection.",[715,763,765,768],{"className":764},[718],[720,766,767],{},"What about separate hostnames for APIs?",[14,769,770],{},"An API on its own hostname needs its own connection; if it is called during load, preconnect to it or serve it from the main origin path.",[715,772,774,777],{"className":773},[718],[720,775,776],{},"Do public library CDNs still help with caching?",[14,778,779],{},"No. Browsers partition caches by site, so a library downloaded on one site is not reused on another. Self-host libraries on your own origin.",[715,781,783,786],{"className":782},[718],[720,784,785],{},"How long should old shard hostnames stay live?",[14,787,788],{},"As long as cached HTML, emails and external links might reference them — typically several months, with monitoring of their traffic.",[715,790,792,795],{"className":791},[718],[720,793,794],{},"How many hostnames should a page use?",[14,796,797],{},"As few as possible on the critical path — ideally the main origin plus at most one or two essential third parties.",[715,799,801,804],{"className":800},[718],[720,802,803],{},"Does sharding affect CDN costs?",[14,805,806],{},"Slightly: more hostnames can mean more certificates, configurations and cache fragmentation. Consolidation usually simplifies operations as well as speeding pages up.",[154,808,810],{"id":809},"related","Related",[159,812,813,820,827],{},[162,814,815,819],{},[18,816,818],{"href":817},"\u002Fnetwork-protocol-optimization\u002Fhttp2-http3-and-connection-management\u002Fconnection-coalescing-and-certificates\u002F","Connection coalescing and certificates"," — when browsers share connections.",[162,821,822,826],{},[18,823,825],{"href":824},"\u002Fadvanced-caching-strategies-cdn-architecture\u002Fresource-hints-and-early-hints\u002Fdns-prefetch-vs-preconnect\u002F","DNS prefetch vs preconnect"," — warming the origins you keep.",[162,828,829,832],{},[18,830,831],{"href":20},"HTTP\u002F2, HTTP\u002F3 & connection management"," — the topic overview.",[834,835,837],"script",{"type":836},"application\u002Fld+json","\n{\n  \"@context\": \"https:\u002F\u002Fschema.org\",\n  \"@type\": \"HowTo\",\n  \"name\": \"Why Domain Sharding Hurts on HTTP\u002F2\",\n  \"description\": \"Why spreading assets across many hostnames slows down HTTP\u002F2 and HTTP\u002F3 sites, and how to consolidate origins without breaking caching or URLs.\",\n  \"step\": [\n    {\n      \"@type\": \"HowToStep\",\n      \"position\": 1,\n      \"name\": \"Measure the cost\",\n      \"text\": \"Measure the cost\"\n    },\n    {\n      \"@type\": \"HowToStep\",\n      \"position\": 2,\n      \"name\": \"Consolidate onto one hostname\",\n      \"text\": \"Serve all static assets from the main origin (through the CDN) or from a single asset hostname.\"\n    },\n    {\n      \"@type\": \"HowToStep\",\n      \"position\": 3,\n      \"name\": \"Redirect or keep old shard hostnames working\",\n      \"text\": \"Keep old hostnames serving the same files (or redirecting) for cached HTML and external references, but stop generating new references to them.\"\n    },\n    {\n      \"@type\": \"HowToStep\",\n      \"position\": 4,\n      \"name\": \"If shards must remain, enable coalescing\",\n      \"text\": \"When separate hostnames cannot be removed quickly, serve them from the same IP addresses with a certificate covering all names, so browsers can coalesce them onto one connection.\"\n    }\n  ]\n}\n",[834,839,840],{"type":836},"\n{\n  \"@context\": \"https:\u002F\u002Fschema.org\",\n  \"@type\": \"TechArticle\",\n  \"headline\": \"Why Domain Sharding Hurts on HTTP\u002F2\",\n  \"description\": \"Why spreading assets across many hostnames slows down HTTP\u002F2 and HTTP\u002F3 sites, and how to consolidate origins without breaking caching or URLs.\",\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\u002Fhttp2-http3-and-connection-management\u002Fwhy-domain-sharding-hurts-on-http2\u002F\"\n  }\n}\n",[834,842,843],{"type":836},"\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\": \"HTTP\u002F2, HTTP\u002F3 & Connection Management\",\n      \"item\": \"https:\u002F\u002Ffrontend-performance.com\u002Fnetwork-protocol-optimization\u002Fhttp2-http3-and-connection-management\u002F\"\n    },\n    {\n      \"@type\": \"ListItem\",\n      \"position\": 4,\n      \"name\": \"Why Domain Sharding Hurts on HTTP\u002F2\",\n      \"item\": \"https:\u002F\u002Ffrontend-performance.com\u002Fnetwork-protocol-optimization\u002Fhttp2-http3-and-connection-management\u002Fwhy-domain-sharding-hurts-on-http2\u002F\"\n    }\n  ]\n}\n",[845,846,847],"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 .sPXB4, html code.shiki .sPXB4{--shiki-default:#023B95;--shiki-dark:#91CBFF;--shiki-light:#023B95}html pre.shiki code .saISM, html code.shiki .saISM{--shiki-default:#0E1116;--shiki-dark:#F0F3F6;--shiki-light:#0E1116}html pre.shiki code .smZ65, html code.shiki .smZ65{--shiki-default:#622CBC;--shiki-dark:#DBB7FF;--shiki-light:#622CBC}html pre.shiki code .sZ8jY, html code.shiki .sZ8jY{--shiki-default:#032563;--shiki-dark:#ADDCFF;--shiki-light:#032563}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":230,"searchDepth":244,"depth":244,"links":849},[850,851,852,858,859,860,861,862,863,864,865],{"id":156,"depth":244,"text":157},{"id":189,"depth":244,"text":190},{"id":217,"depth":244,"text":218,"children":853},[854,855,856,857],{"id":222,"depth":262,"text":223},{"id":409,"depth":262,"text":410},{"id":416,"depth":262,"text":417},{"id":423,"depth":262,"text":424},{"id":498,"depth":244,"text":499},{"id":505,"depth":244,"text":506},{"id":640,"depth":244,"text":641},{"id":647,"depth":244,"text":648},{"id":654,"depth":244,"text":655},{"id":684,"depth":244,"text":685},{"id":712,"depth":244,"text":713},{"id":809,"depth":244,"text":810},"Why spreading assets across many hostnames slows down HTTP\u002F2 and HTTP\u002F3 sites, and how to consolidate origins without breaking caching or URLs.","md",{"slug":12,"type":869,"breadcrumb":870,"datePublished":878,"dateModified":878},"article",[871,874,875,876],{"name":872,"url":873},"Home","\u002F",{"name":26,"url":25},{"name":21,"url":20},{"name":5,"url":877},"\u002Fnetwork-protocol-optimization\u002Fhttp2-http3-and-connection-management\u002Fwhy-domain-sharding-hurts-on-http2\u002F","2026-10-06",true,"\u002Fnetwork-protocol-optimization\u002Fhttp2-http3-and-connection-management\u002Fwhy-domain-sharding-hurts-on-http2",{"title":882,"description":883},"Why Domain Sharding Hurts Performance on HTTP\u002F2","Domain sharding adds DNS, TCP and TLS setup and splits HTTP\u002F2 prioritisation. Learn how to consolidate asset hostnames safely and when coalescing saves you.","network-protocol-optimization\u002Fhttp2-http3-and-connection-management\u002Fwhy-domain-sharding-hurts-on-http2\u002Findex","LD2nXo-Usek0x4Hg5beGRj5b8QJX0qDFkXfw_uJrPDk",[887,891],{"title":888,"path":889,"stem":890},"Measuring Real-World HTTP\u002F3 Gains","\u002Fnetwork-protocol-optimization\u002Fhttp2-http3-and-connection-management\u002Fmeasuring-real-world-http3-gains","network-protocol-optimization\u002Fhttp2-http3-and-connection-management\u002Fmeasuring-real-world-http3-gains\u002Findex",{"title":892,"path":893,"stem":894},"Speculative Loading & Prefetching","\u002Fnetwork-protocol-optimization\u002Fspeculative-loading-and-prefetching","network-protocol-optimization\u002Fspeculative-loading-and-prefetching\u002Findex",1791308076379]