[{"data":1,"prerenderedAt":994},["ShallowReactive",2],{"content:\u002Fnetwork-protocol-optimization\u002Ftime-to-first-byte-optimization\u002Feliminating-redirect-chains":3,"surroundings:\u002Fnetwork-protocol-optimization\u002Ftime-to-first-byte-optimization\u002Feliminating-redirect-chains":985},{"id":4,"title":5,"body":6,"description":963,"extension":964,"meta":965,"navigation":978,"path":979,"seo":980,"stem":983,"__hash__":984},"content\u002Fnetwork-protocol-optimization\u002Ftime-to-first-byte-optimization\u002Feliminating-redirect-chains\u002Findex.md","Eliminating Redirect Chains",{"type":7,"value":8,"toc":945},"minimark",[9,14,38,56,214,219,268,272,278,284,290,296,300,305,384,388,391,469,473,476,480,483,560,564,570,574,595,722,726,745,755,759,762,766,792,796,802,808,814,820,824,836,845,854,863,872,886,895,904,908,930,935,938,941],[10,11,13],"h1",{"id":12},"how-to-eliminate-redirect-chains","How to Eliminate Redirect Chains",[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\u002Ftime-to-first-byte-optimization\u002F","Time to First Byte Optimization",", within ",[19,25,27],{"href":26},"\u002Fnetwork-protocol-optimization\u002F","Network & Server Response Optimization",". A redirect tells the browser to request a different URL before it receives any content. Each hop is at least one full round trip, and when it switches hosts (from ",[30,31,32],"code",{},"example.com"," to ",[30,35,36],{},"www.example.com",", or from a tracking domain to the site), it also requires DNS, TCP and TLS for the new host. On mobile networks, a single cross-host redirect can cost 300ms or more, and chains of three or four hops are surprisingly common.",[15,39,40,41,33,44,47,48,51,52,55],{},"Chains form gradually: ",[30,42,43],{},"http",[30,45,46],{},"https",", apex to ",[30,49,50],{},"www",", adding a trailing slash, a locale prefix based on ",[30,53,54],{},"Accept-Language",", an old URL structure that was migrated, and a campaign or link-shortener redirect on top. Each rule makes sense alone; together they add a second to TTFB before the server has even started rendering the page.",[15,57,58],{},[59,60,66,67,66,74,66,78,66,81,66,90,66,96,66,107,66,112,66,120,66,127,66,131,66,135,66,138,66,142,66,146,66,150,66,154,66,160,66,165,66,170,66,176,66,180,66,184,66,188,66,192,66,196,66,200,66,204,66,208,66],"svg",{"viewBox":61,"width":62,"role":63,"ariaLabel":64,"style":65},"0 0 760 200","100%","img","Timeline of a navigation passing through a link shortener, http to https, apex to www, and a trailing slash redirect before reaching the final page.","height:auto;max-width:760px;display:block;margin:1.75rem auto;font-family:inherit;color:var(--fp-svg-ink)"," ",[68,69],"rect",{"className":70,"x":72,"y":72,"width":62,"height":62,"fill":73},[71],"svg-canvas","0","#ffffff",[75,76,77],"title",{},"A four-hop redirect chain on mobile",[79,80,64],"desc",{},[68,82],{"x":83,"y":83,"width":84,"height":85,"rx":86,"fill":87,"stroke":88,"style":89},"1","758","198","10","none","currentColor","stroke-opacity:0.18",[91,92,77],"text",{"x":93,"y":94,"fill":88,"style":95},"28.0","34.0","font-size:16px;font-weight:700",[97,98],"line",{"x1":99,"y1":100,"x2":99,"y2":101,"stroke":102,"strokeWidth":103,"strokeDashArray":104,"style":106},"710.4","72.0","156.0","#b8860b","1.5",[105,105],"4","stroke-opacity:0.9",[91,108,111],{"x":93,"y":109,"fill":88,"style":110},"96.0","font-size:12.5px;font-weight:700","Redirects",[68,113],{"x":114,"y":115,"width":116,"height":117,"rx":118,"fill":87,"stroke":88,"style":119},"104.1","78.0","146.4","26.0","3","stroke-opacity:0.35",[91,121,126],{"x":122,"y":123,"fill":88,"style":124,"textAnchor":125},"177.3","95.5","font-size:11.5px","middle","short link (new host)",[68,128],{"x":129,"y":115,"width":130,"height":117,"rx":118,"fill":87,"stroke":88,"style":119},"252.0","123.0",[91,132,134],{"x":133,"y":123,"fill":88,"style":124,"textAnchor":125},"313.5","http to https",[68,136],{"x":137,"y":115,"width":130,"height":117,"rx":118,"fill":87,"stroke":88,"style":119},"376.5",[91,139,141],{"x":140,"y":123,"fill":88,"style":124,"textAnchor":125},"438.0","apex to www",[68,143],{"x":144,"y":115,"width":145,"height":117,"rx":118,"fill":87,"stroke":88,"style":119},"501.0","60.8",[91,147,149],{"x":148,"y":123,"fill":88,"style":124,"textAnchor":125},"531.4","add slash",[91,151,153],{"x":93,"y":152,"fill":88,"style":110},"134.0","Final page",[68,155],{"x":156,"y":157,"width":116,"height":117,"rx":118,"fill":158,"stroke":158,"style":159},"563.3","116.0","#0466c8","fill-opacity:0.14;stroke-opacity:0.9",[91,161,164],{"x":162,"y":163,"fill":88,"style":124,"textAnchor":125},"636.5","133.5","server + first byte",[97,166],{"x1":167,"y1":101,"x2":168,"y2":101,"stroke":88,"style":169},"103.3","726.0","stroke-opacity:0.4",[91,171,175],{"x":172,"y":173,"fill":174,"style":124,"textAnchor":125},"114.0","173.0","#51617a","0ms",[91,177,179],{"x":178,"y":173,"fill":174,"style":124,"textAnchor":125},"181.2","200ms",[91,181,183],{"x":182,"y":173,"fill":174,"style":124,"textAnchor":125},"259.0","400ms",[91,185,187],{"x":186,"y":173,"fill":174,"style":124,"textAnchor":125},"336.8","600ms",[91,189,191],{"x":190,"y":173,"fill":174,"style":124,"textAnchor":125},"414.7","800ms",[91,193,195],{"x":194,"y":173,"fill":174,"style":124,"textAnchor":125},"492.5","1000ms",[91,197,199],{"x":198,"y":173,"fill":174,"style":124,"textAnchor":125},"570.3","1200ms",[91,201,203],{"x":202,"y":173,"fill":174,"style":124,"textAnchor":125},"648.2","1400ms",[91,205,207],{"x":206,"y":173,"fill":174,"style":124,"textAnchor":125},"712.3","1600ms",[91,209,213],{"x":99,"y":210,"fill":211,"style":212,"textAnchor":125},"68.0","#8a6608","font-size:12px;font-weight:700","TTFB",[215,216,218],"h2",{"id":217},"rapid-diagnosis","Rapid Diagnosis",[220,221,222,242,252,258],"ul",{},[223,224,225,229,230,233,234,237,238,241],"li",{},[226,227,228],"strong",{},"Check RUM"," for ",[30,231,232],{},"redirectCount"," and ",[30,235,236],{},"redirectEnd - redirectStart"," per landing page (same-origin redirects only; cross-origin redirect time shows as a gap before ",[30,239,240],{},"fetchStart",").",[223,243,244,247,248,251],{},[226,245,246],{},"Trace common entry URLs"," with ",[30,249,250],{},"curl -sIL"," to list each hop.",[223,253,254,257],{},[226,255,256],{},"Crawl the site"," with a tool that reports internal links pointing at redirecting URLs.",[223,259,260,263,264,267],{},[226,261,262],{},"Check campaign, email and social links"," — they often use old URLs or ",[30,265,266],{},"http:\u002F\u002F",".",[215,269,271],{"id":270},"root-cause-analysis","Root Cause Analysis",[15,273,274,277],{},[226,275,276],{},"1. Layered canonicalisation rules."," Each rule (protocol, host, slash, case) adds its own hop.",[15,279,280,283],{},[226,281,282],{},"2. Outdated internal links."," Navigation and content still point to old URLs.",[15,285,286,289],{},[226,287,288],{},"3. Marketing and tracking redirects."," Link shorteners and click trackers add cross-host hops.",[15,291,292,295],{},[226,293,294],{},"4. Locale or device redirects."," Server-side redirects based on headers instead of serving the right content directly.",[215,297,299],{"id":298},"step-by-step-resolution","Step-by-Step Resolution",[301,302,304],"h3",{"id":303},"_1-map-the-chains","1. Map the chains",[306,307,312],"pre",{"className":308,"code":309,"language":310,"meta":311,"style":311},"language-bash shiki shiki-themes github-light-high-contrast github-dark-high-contrast github-light-high-contrast","# List every hop and its timing for an entry URL.\ncurl -sIL -o \u002Fdev\u002Fnull -w '%{url_effective} %{num_redirects} redirects %{time_redirect}s\\n' http:\u002F\u002Fexample.com\u002FShoes\ncurl -sIL http:\u002F\u002Fexample.com\u002FShoes | grep -iE '^(HTTP|location)'\n# trade-off: curl from a data centre underestimates mobile cost; multiply hop\n# count by your field round-trip time for a realistic estimate.\n","bash","",[30,313,314,322,349,372,378],{"__ignoreMap":311},[315,316,318],"span",{"class":97,"line":317},1,[315,319,321],{"class":320},"sjfSM","# List every hop and its timing for an entry URL.\n",[315,323,325,329,333,336,340,343,346],{"class":97,"line":324},2,[315,326,328],{"class":327},"sQw3B","curl",[315,330,332],{"class":331},"sPXB4"," -sIL",[315,334,335],{"class":331}," -o",[315,337,339],{"class":338},"sZ8jY"," \u002Fdev\u002Fnull",[315,341,342],{"class":331}," -w",[315,344,345],{"class":338}," '%{url_effective} %{num_redirects} redirects %{time_redirect}s\\n'",[315,347,348],{"class":338}," http:\u002F\u002Fexample.com\u002FShoes\n",[315,350,352,354,356,359,363,366,369],{"class":97,"line":351},3,[315,353,328],{"class":327},[315,355,332],{"class":331},[315,357,358],{"class":338}," http:\u002F\u002Fexample.com\u002FShoes",[315,360,362],{"class":361},"sPARh"," |",[315,364,365],{"class":327}," grep",[315,367,368],{"class":331}," -iE",[315,370,371],{"class":338}," '^(HTTP|location)'\n",[315,373,375],{"class":97,"line":374},4,[315,376,377],{"class":320},"# trade-off: curl from a data centre underestimates mobile cost; multiply hop\n",[315,379,381],{"class":97,"line":380},5,[315,382,383],{"class":320},"# count by your field round-trip time for a realistic estimate.\n",[301,385,387],{"id":386},"_2-collapse-canonicalisation-into-one-hop","2. Collapse canonicalisation into one hop",[15,389,390],{},"Compute the final canonical URL in a single rule (protocol, host, path normalisation together) and redirect once.",[306,392,396],{"className":393,"code":394,"language":395,"meta":311,"style":311},"language-nginx shiki shiki-themes github-light-high-contrast github-dark-high-contrast github-light-high-contrast","# One hop from any non-canonical form to the canonical URL.\nserver {\n  listen 80; listen 443 ssl; server_name example.com;\n  return 301 https:\u002F\u002Fwww.example.com$request_uri;    # protocol + host together\n}\n# trade-off: path normalisation (slashes, case) still needs app-level logic; do it\n# in the same response where possible rather than a second redirect.\n","nginx",[30,397,398,403,412,438,452,457,463],{"__ignoreMap":311},[315,399,400],{"class":97,"line":317},[315,401,402],{"class":320},"# One hop from any non-canonical form to the canonical URL.\n",[315,404,405,408],{"class":97,"line":324},[315,406,407],{"class":361},"server",[315,409,411],{"class":410},"saISM"," {\n",[315,413,414,417,420,423,426,429,432,435],{"class":97,"line":351},[315,415,416],{"class":361},"  listen ",[315,418,419],{"class":331},"80",[315,421,422],{"class":410},";",[315,424,425],{"class":361}," listen ",[315,427,428],{"class":331},"443",[315,430,431],{"class":410}," ssl;",[315,433,434],{"class":361}," server_name ",[315,436,437],{"class":410},"example.com;\n",[315,439,440,443,446,449],{"class":97,"line":374},[315,441,442],{"class":361},"  return",[315,444,445],{"class":331}," 301",[315,447,448],{"class":410}," https:\u002F\u002Fwww.example.com$request_uri;    ",[315,450,451],{"class":320},"# protocol + host together\n",[315,453,454],{"class":97,"line":380},[315,455,456],{"class":410},"}\n",[315,458,460],{"class":97,"line":459},6,[315,461,462],{"class":320},"# trade-off: path normalisation (slashes, case) still needs app-level logic; do it\n",[315,464,466],{"class":97,"line":465},7,[315,467,468],{"class":320},"# in the same response where possible rather than a second redirect.\n",[301,470,472],{"id":471},"_3-fix-internal-links-at-the-source","3. Fix internal links at the source",[15,474,475],{},"Update navigation, content, sitemaps and canonical tags to use final URLs, so most navigations involve no redirect at all.",[301,477,479],{"id":478},"_4-replace-redirect-based-tracking","4. Replace redirect-based tracking",[15,481,482],{},"Use UTM parameters on final URLs instead of click-tracking redirects where possible. For email links, ask the email provider to use first-party tracking domains with fast redirects, or link directly.",[15,484,485],{},[59,486,66,489,66,492,66,495,66,497,66,500,66,502,66,509,66,516,66,521,66,525,66,530,66,534,66,538,66,542,66,546,66,550,66,556,66],{"viewBox":487,"width":62,"role":63,"ariaLabel":488,"style":65},"0 0 760 194","Bar chart of TTFB at the 75th percentile for email campaign traffic before and after collapsing redirects.",[68,490],{"className":491,"x":72,"y":72,"width":62,"height":62,"fill":73},[71],[75,493,494],{},"TTFB p75 for email campaign landings",[79,496,488],{},[68,498],{"x":83,"y":83,"width":84,"height":499,"rx":86,"fill":87,"stroke":88,"style":89},"192",[91,501,494],{"x":93,"y":94,"fill":88,"style":95},[91,503,508],{"x":504,"y":505,"fill":88,"style":506,"textAnchor":507},"221.0","70.0","font-size:13px","end","4 hops (tracker, http, apex, slash)",[68,510],{"x":511,"y":512,"width":513,"height":514,"rx":118,"fill":87,"stroke":88,"style":515},"233.0","56.0","435.0","19","fill-opacity:0.7;stroke-opacity:0.35",[91,517,520],{"x":518,"y":505,"fill":88,"style":519},"674.0","font-size:12px;font-weight:600","1640ms",[91,522,524],{"x":504,"y":523,"fill":88,"style":506,"textAnchor":507},"101.0","2 hops (tracker, canonical)",[68,526],{"x":511,"y":527,"width":528,"height":514,"rx":118,"fill":158,"stroke":158,"style":529},"87.0","259.9","fill-opacity:0.55;stroke-opacity:0.9",[91,531,533],{"x":532,"y":523,"fill":88,"style":519},"498.9","980ms",[91,535,537],{"x":504,"y":536,"fill":88,"style":506,"textAnchor":507},"132.0","1 hop (first-party tracker)",[68,539],{"x":511,"y":540,"width":541,"height":514,"rx":118,"fill":158,"stroke":158,"style":529},"118.0","164.4",[91,543,545],{"x":544,"y":536,"fill":88,"style":519},"403.5","620ms",[91,547,549],{"x":504,"y":548,"fill":88,"style":506,"textAnchor":507},"163.0","0 hops (direct link + UTM)",[68,551],{"x":511,"y":552,"width":553,"height":514,"rx":118,"fill":554,"stroke":102,"style":555},"149.0","108.7","#ffc300","fill-opacity:0.7;stroke-opacity:0.9",[91,557,559],{"x":558,"y":548,"fill":88,"style":519},"347.8","410ms",[215,561,563],{"id":562},"verification","Verification",[15,565,566,567,569],{},"Re-run ",[30,568,250],{}," on entry URLs: one hop at most for non-canonical forms, zero for links you control. In RUM, the share of navigations with redirects should fall, and TTFB p75 for affected landing pages should drop. Check search console for crawl errors after changes.",[215,571,573],{"id":572},"worked-example-a-retailers-email-campaigns","Worked Example: A Retailer's Email Campaigns",[15,575,576,577,580,581,584,585,584,588,591,592,594],{},"A retailer's email campaigns linked through the email platform's click tracker (on its own domain) to ",[30,578,579],{},"http:\u002F\u002Fexample.com\u002Fsale",", which redirected to ",[30,582,583],{},"https:\u002F\u002Fexample.com\u002Fsale",", then to ",[30,586,587],{},"https:\u002F\u002Fwww.example.com\u002Fsale",[30,589,590],{},"https:\u002F\u002Fwww.example.com\u002Fsale\u002F",". Campaign landing TTFB p75 on mobile was 1.6 seconds, and LCP p75 for campaign traffic was 1.1 seconds worse than organic traffic to the same pages. The team switched email templates to canonical HTTPS ",[30,593,50],{}," URLs with trailing slashes, configured a first-party click tracking domain with a fast edge redirect, and merged the remaining protocol and host rules into one. Campaign landing TTFB dropped to 620ms and LCP p75 by 900ms; campaign conversion rate improved measurably in the following weeks.",[15,596,597],{},[59,598,66,601,66,604,66,607,66,609,66,612,66,614,66,619,66,625,66,629,66,633,66,636,66,640,66,643,66,646,66,648,66,652,66,654,66,657,66,659,66,662,66,665,66,668,66,670,66,673,66,676,66,680,66,682,66,684,66,686,66,689,66,692,66,696,66,698,66,701,66,703,66,706,66,709,66,713,66,715,66,717,66,719,66],{"viewBox":599,"width":62,"role":63,"ariaLabel":600,"style":65},"0 0 760 258","Typical causes of redirects before the first byte and how to remove or collapse each.",[68,602],{"className":603,"x":72,"y":72,"width":62,"height":62,"fill":73},[71],[75,605,606],{},"Common redirect sources and their fixes",[79,608,600],{},[68,610],{"x":83,"y":83,"width":84,"height":611,"rx":86,"fill":87,"stroke":88,"style":89},"256",[91,613,606],{"x":93,"y":94,"fill":88,"style":95},[68,615],{"x":93,"y":512,"width":616,"height":617,"rx":72,"fill":88,"stroke":88,"style":618},"108.5","30.0","fill-opacity:0.06;stroke-opacity:0.4",[91,620,624],{"x":621,"y":622,"fill":88,"style":110,"textAnchor":623},"38.0","75.5","start","Source",[68,626],{"x":627,"y":512,"width":628,"height":617,"rx":72,"fill":88,"stroke":88,"style":618},"136.5","297.8",[91,630,632],{"x":631,"y":622,"fill":88,"style":110,"textAnchor":125},"285.4","Typical cost",[68,634],{"x":635,"y":512,"width":628,"height":617,"rx":72,"fill":88,"stroke":88,"style":618},"434.2",[91,637,639],{"x":638,"y":622,"fill":88,"style":110,"textAnchor":125},"583.1","Fix",[68,641],{"x":93,"y":642,"width":616,"height":617,"rx":72,"fill":87,"stroke":88,"style":119},"86.0",[91,644,134],{"x":621,"y":645,"fill":88,"style":110,"textAnchor":623},"105.5",[68,647],{"x":627,"y":642,"width":628,"height":617,"rx":72,"fill":88,"stroke":88,"style":618},[91,649,651],{"x":631,"y":645,"fill":88,"style":650,"textAnchor":125},"font-size:12px","1 round trip",[68,653],{"x":635,"y":642,"width":628,"height":617,"rx":72,"fill":87,"stroke":88,"style":119},[91,655,656],{"x":638,"y":645,"fill":88,"style":650,"textAnchor":125},"HSTS + preload",[68,658],{"x":93,"y":157,"width":616,"height":617,"rx":72,"fill":87,"stroke":88,"style":119},[91,660,141],{"x":621,"y":661,"fill":88,"style":110,"textAnchor":623},"135.5",[68,663],{"x":627,"y":157,"width":628,"height":617,"rx":72,"fill":554,"stroke":102,"style":664},"fill-opacity:0.24;stroke-opacity:0.9",[91,666,667],{"x":631,"y":661,"fill":88,"style":650,"textAnchor":125},"new connection",[68,669],{"x":635,"y":157,"width":628,"height":617,"rx":72,"fill":87,"stroke":88,"style":119},[91,671,672],{"x":638,"y":661,"fill":88,"style":650,"textAnchor":125},"combine with protocol rule",[68,674],{"x":93,"y":675,"width":616,"height":617,"rx":72,"fill":87,"stroke":88,"style":119},"146.0",[91,677,679],{"x":621,"y":678,"fill":88,"style":110,"textAnchor":623},"165.5","Trailing slash",[68,681],{"x":627,"y":675,"width":628,"height":617,"rx":72,"fill":88,"stroke":88,"style":618},[91,683,651],{"x":631,"y":678,"fill":88,"style":650,"textAnchor":125},[68,685],{"x":635,"y":675,"width":628,"height":617,"rx":72,"fill":87,"stroke":88,"style":119},[91,687,688],{"x":638,"y":678,"fill":88,"style":650,"textAnchor":125},"link to final URL",[68,690],{"x":93,"y":691,"width":616,"height":617,"rx":72,"fill":87,"stroke":88,"style":119},"176.0",[91,693,695],{"x":621,"y":694,"fill":88,"style":110,"textAnchor":623},"195.5","Click tracker",[68,697],{"x":627,"y":691,"width":628,"height":617,"rx":72,"fill":554,"stroke":102,"style":664},[91,699,700],{"x":631,"y":694,"fill":88,"style":650,"textAnchor":125},"new host",[68,702],{"x":635,"y":691,"width":628,"height":617,"rx":72,"fill":87,"stroke":88,"style":119},[91,704,705],{"x":638,"y":694,"fill":88,"style":650,"textAnchor":125},"first-party tracker or UTM",[68,707],{"x":93,"y":708,"width":616,"height":617,"rx":72,"fill":87,"stroke":88,"style":119},"206.0",[91,710,712],{"x":621,"y":711,"fill":88,"style":110,"textAnchor":623},"225.5","Locale redirect",[68,714],{"x":627,"y":708,"width":628,"height":617,"rx":72,"fill":88,"stroke":88,"style":618},[91,716,651],{"x":631,"y":711,"fill":88,"style":650,"textAnchor":125},[68,718],{"x":635,"y":708,"width":628,"height":617,"rx":72,"fill":87,"stroke":88,"style":119},[91,720,721],{"x":638,"y":711,"fill":88,"style":650,"textAnchor":125},"serve at requested URL",[215,723,725],{"id":724},"hsts-and-preloading","HSTS and Preloading",[15,727,728,729,33,731,733,734,737,738,740,741,744],{},"The ",[30,730,43],{},[30,732,46],{}," redirect can be eliminated for returning visitors with HTTP Strict Transport Security: the ",[30,735,736],{},"Strict-Transport-Security"," header tells browsers to always use HTTPS for the domain, so they rewrite ",[30,739,266],{}," URLs internally without a network round trip. Submitting the domain to the HSTS preload list extends this to first visits in browsers that ship the list. Before preloading, ensure every subdomain supports HTTPS, since preloading with ",[30,742,743],{},"includeSubDomains"," applies to all of them and is slow to undo.",[306,746,749],{"className":747,"code":748,"language":43,"meta":311,"style":311},"language-http shiki shiki-themes github-light-high-contrast github-dark-high-contrast github-light-high-contrast","Strict-Transport-Security: max-age=63072000; includeSubDomains; preload\n",[30,750,751],{"__ignoreMap":311},[315,752,753],{"class":97,"line":317},[315,754,748],{},[215,756,758],{"id":757},"auditing-redirects-continuously","Auditing Redirects Continuously",[15,760,761],{},"Redirects creep back as new campaigns launch and URLs change. Add an automated check that requests your top entry URLs (from analytics) and every URL in the sitemap, and fails if any returns a redirect or if a chain exceeds one hop. Run the same check on links in email templates and ad campaigns before they go out. In RUM, chart the share of navigations with redirects by referrer: a sudden rise from one source usually means a new campaign link or partner integration that points at an old URL. Fix the link at its source rather than adding another redirect rule.",[215,763,765],{"id":764},"common-mistakes","Common Mistakes",[220,767,768,774,780,786],{},[223,769,770,773],{},[226,771,772],{},"Chained canonical rules."," Protocol, host and slash handled in separate hops.",[223,775,776,779],{},[226,777,778],{},"Internal links to redirecting URLs."," Every click pays a redirect.",[223,781,782,785],{},[226,783,784],{},"302 instead of 301 for permanent moves."," Browsers and caches do not remember temporary redirects.",[223,787,788,791],{},[226,789,790],{},"JavaScript or meta-refresh redirects."," Even slower: the page must load before redirecting.",[215,793,795],{"id":794},"edge-cases","Edge Cases",[15,797,798,801],{},[226,799,800],{},"Locale detection."," Prefer serving content in the detected language at the requested URL with a language switcher, or redirect once from the root only.",[15,803,804,807],{},[226,805,806],{},"Trailing slash conventions."," Choose one and generate all links accordingly; static hosts often redirect directory URLs to slash forms automatically.",[15,809,810,813],{},[226,811,812],{},"Cached redirects."," Browsers cache 301 redirects aggressively; test changes with fresh profiles.",[15,815,816,819],{},[226,817,818],{},"Single-page apps."," Client-side route redirects do not cost network round trips but do delay rendering; keep them out of entry paths.",[215,821,823],{"id":822},"faq","FAQ",[825,826,829,833],"details",{"className":827},[828],"faq-item",[830,831,832],"summary",{},"How much time does a redirect add?",[15,834,835],{},"At least one round trip — often 100–300ms on mobile — and more if it changes hosts and needs a new connection.",[825,837,839,842],{"className":838},[828],[830,840,841],{},"Do redirects affect SEO?",[15,843,844],{},"Search engines follow redirects, but chains waste crawl budget and can dilute signals. One hop to the canonical URL is the recommended pattern.",[825,846,848,851],{"className":847},[828],[830,849,850],{},"Should I use 301 or 308?",[15,852,853],{},"Both are permanent. 308 preserves the request method (useful for POST); for page navigations, 301 is standard and widely supported.",[825,855,857,860],{"className":856},[828],[830,858,859],{},"Are redirects counted in TTFB?",[15,861,862],{},"Yes, in the web-vitals definition, which measures from navigation start.",[825,864,866,869],{"className":865},[828],[830,867,868],{},"Can a CDN make redirects faster?",[15,870,871],{},"Yes. Serving redirects at the edge avoids a trip to the origin, though the browser still needs the extra round trip.",[825,873,875,878],{"className":874},[828],[830,876,877],{},"How do I find redirects in RUM?",[15,879,880,881,883,884,267],{},"Navigation Timing reports ",[30,882,232],{}," and redirect timing for same-origin redirects. Cross-origin redirects show as time before ",[30,885,240],{},[825,887,889,892],{"className":888},[828],[830,890,891],{},"What about link shorteners on social media?",[15,893,894],{},"Platforms often wrap links in their own shorteners, which you cannot avoid. Make sure the destination is your final canonical URL so no additional hops follow.",[825,896,898,901],{"className":897},[828],[830,899,900],{},"Do redirects affect LCP in Core Web Vitals reports?",[15,902,903],{},"Yes. LCP is measured from navigation start, so redirect time before the final page counts towards it, and campaign traffic with long chains often has noticeably worse LCP.",[215,905,907],{"id":906},"related","Related",[220,909,910,916,923],{},[223,911,912,915],{},[19,913,914],{"href":21},"Time to First Byte (TTFB) optimization"," — the full TTFB workflow.",[223,917,918,922],{},[19,919,921],{"href":920},"\u002Fadvanced-caching-strategies-cdn-architecture\u002Fresource-hints-and-early-hints\u002Fdns-prefetch-vs-preconnect\u002F","DNS prefetch vs preconnect"," — connection costs for other hosts.",[223,924,925,929],{},[19,926,928],{"href":927},"\u002Fnetwork-protocol-optimization\u002Fhttp2-http3-and-connection-management\u002Fconnection-coalescing-and-certificates\u002F","Connection coalescing and certificates"," — reducing connection setups.",[931,932,934],"script",{"type":933},"application\u002Fld+json","\n{\n  \"@context\": \"https:\u002F\u002Fschema.org\",\n  \"@type\": \"HowTo\",\n  \"name\": \"How to Eliminate Redirect Chains\",\n  \"description\": \"How redirect chains inflate TTFB, how to find them in field data and crawls, and how to collapse them without breaking SEO or tracking.\",\n  \"step\": [\n    {\n      \"@type\": \"HowToStep\",\n      \"position\": 1,\n      \"name\": \"Map the chains\",\n      \"text\": \"Map the chains\"\n    },\n    {\n      \"@type\": \"HowToStep\",\n      \"position\": 2,\n      \"name\": \"Collapse canonicalisation into one hop\",\n      \"text\": \"Compute the final canonical URL in a single rule (protocol, host, path normalisation together) and redirect once.\"\n    },\n    {\n      \"@type\": \"HowToStep\",\n      \"position\": 3,\n      \"name\": \"Fix internal links at the source\",\n      \"text\": \"Update navigation, content, sitemaps and canonical tags to use final URLs, so most navigations involve no redirect at all.\"\n    },\n    {\n      \"@type\": \"HowToStep\",\n      \"position\": 4,\n      \"name\": \"Replace redirect-based tracking\",\n      \"text\": \"Use UTM parameters on final URLs instead of click-tracking redirects where possible.\"\n    }\n  ]\n}\n",[931,936,937],{"type":933},"\n{\n  \"@context\": \"https:\u002F\u002Fschema.org\",\n  \"@type\": \"TechArticle\",\n  \"headline\": \"How to Eliminate Redirect Chains\",\n  \"description\": \"How redirect chains inflate TTFB, how to find them in field data and crawls, and how to collapse them without breaking SEO or tracking.\",\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\u002Ftime-to-first-byte-optimization\u002Feliminating-redirect-chains\u002F\"\n  }\n}\n",[931,939,940],{"type":933},"\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\": \"Time to First Byte (TTFB) Optimization\",\n      \"item\": \"https:\u002F\u002Ffrontend-performance.com\u002Fnetwork-protocol-optimization\u002Ftime-to-first-byte-optimization\u002F\"\n    },\n    {\n      \"@type\": \"ListItem\",\n      \"position\": 4,\n      \"name\": \"Eliminating Redirect Chains\",\n      \"item\": \"https:\u002F\u002Ffrontend-performance.com\u002Fnetwork-protocol-optimization\u002Ftime-to-first-byte-optimization\u002Feliminating-redirect-chains\u002F\"\n    }\n  ]\n}\n",[942,943,944],"style",{},"html pre.shiki code .sjfSM, html code.shiki .sjfSM{--shiki-default:#66707B;--shiki-dark:#BDC4CC;--shiki-light:#66707B}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 pre.shiki code .sZ8jY, html code.shiki .sZ8jY{--shiki-default:#032563;--shiki-dark:#ADDCFF;--shiki-light:#032563}html pre.shiki code .sPARh, html code.shiki .sPARh{--shiki-default:#A0111F;--shiki-dark:#FF9492;--shiki-light:#A0111F}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);}html pre.shiki code .saISM, html code.shiki .saISM{--shiki-default:#0E1116;--shiki-dark:#F0F3F6;--shiki-light:#0E1116}",{"title":311,"searchDepth":324,"depth":324,"links":946},[947,948,949,955,956,957,958,959,960,961,962],{"id":217,"depth":324,"text":218},{"id":270,"depth":324,"text":271},{"id":298,"depth":324,"text":299,"children":950},[951,952,953,954],{"id":303,"depth":351,"text":304},{"id":386,"depth":351,"text":387},{"id":471,"depth":351,"text":472},{"id":478,"depth":351,"text":479},{"id":562,"depth":324,"text":563},{"id":572,"depth":324,"text":573},{"id":724,"depth":324,"text":725},{"id":757,"depth":324,"text":758},{"id":764,"depth":324,"text":765},{"id":794,"depth":324,"text":795},{"id":822,"depth":324,"text":823},{"id":906,"depth":324,"text":907},"How redirect chains inflate TTFB, how to find them in field data and crawls, and how to collapse them without breaking SEO or tracking.","md",{"slug":966,"type":967,"breadcrumb":968,"datePublished":977,"dateModified":977},"eliminating-redirect-chains","article",[969,972,973,975],{"name":970,"url":971},"Home","\u002F",{"name":27,"url":26},{"name":974,"url":21},"Time to First Byte (TTFB) Optimization",{"name":5,"url":976},"\u002Fnetwork-protocol-optimization\u002Ftime-to-first-byte-optimization\u002Feliminating-redirect-chains\u002F","2026-10-06",true,"\u002Fnetwork-protocol-optimization\u002Ftime-to-first-byte-optimization\u002Feliminating-redirect-chains",{"title":981,"description":982},"Eliminating Redirect Chains to Cut TTFB","Each redirect adds a round trip and often a new connection. Find chains from http, www, slashes, locales and tracking links, and collapse them.","network-protocol-optimization\u002Ftime-to-first-byte-optimization\u002Feliminating-redirect-chains\u002Findex","HxnCskyZzbABCAHowBmVlCF-3Nb7nAeRwThH4DJHae8",[986,990],{"title":987,"path":988,"stem":989},"Diagnosing Slow TTFB with Server-Timing","\u002Fnetwork-protocol-optimization\u002Ftime-to-first-byte-optimization\u002Fdiagnosing-slow-ttfb-with-server-timing","network-protocol-optimization\u002Ftime-to-first-byte-optimization\u002Fdiagnosing-slow-ttfb-with-server-timing\u002Findex",{"title":991,"path":992,"stem":993},"Fixing TTFB from Serverless Cold Starts","\u002Fnetwork-protocol-optimization\u002Ftime-to-first-byte-optimization\u002Ffixing-ttfb-from-serverless-cold-starts","network-protocol-optimization\u002Ftime-to-first-byte-optimization\u002Ffixing-ttfb-from-serverless-cold-starts\u002Findex",1791308077123]