[{"data":1,"prerenderedAt":3918},["ShallowReactive",2],{"article-alternates":3,"article-\u002Fen\u002Ftech\u002Fheadless-ecommerce-migration-roadmap-risk-management":13},{"i18nKey":4,"paths":5},"tech-006-2026-06",{"de":6,"en":7,"es":8,"fr":9,"it":10,"ru":11,"tr":12},"\u002Fde\u002Ftech\u002Fheadless-ecommerce-migration-roadmap","\u002Fen\u002Ftech\u002Fheadless-ecommerce-migration-roadmap-risk-management","\u002Fes\u002Ftech\u002Fmigracion-headless-hoja-ruta-gestion-riesgos","\u002Ffr\u002Ftech\u002Fstrategie-migration-headless-commerce","\u002Fit\u002Ftech\u002Fmigrazione-headless-e-commerce-roadmap-e-gestione-rischi","\u002Fru\u002Ftech\u002Fmigracao-ecommerce-headless-roadmap-gestao-risco","\u002Ftr\u002Ftech\u002Fheadless-e-ticaret-migration-roadmap-ve-risk-yonetimi",{"_path":7,"_dir":14,"_draft":15,"_partial":15,"_locale":16,"title":17,"description":18,"publishedAt":19,"modifiedAt":19,"category":20,"i18nKey":4,"tags":21,"readingTime":27,"author":28,"body":29,"_type":3912,"_id":3913,"_source":3914,"_file":3915,"_stem":3916,"_extension":3917},"tech",false,"","Headless E-Commerce Migration: Roadmap and Risk Management","Plan headless e-commerce transition with phased rollout strategy, SEO protection, and cart abandonment analysis backed by concrete metrics.","2026-06-28","headless",[22,23,24,25,26],"headless-commerce","migration","seo-preservation","performance-optimization","risk-management",8,"Roibase",{"type":30,"children":31,"toc":3899},"root",[32,40,47,52,793,806,819,826,831,1004,1009,1015,1020,1025,1135,1140,1410,1431,1840,1845,1851,1883,1889,1894,1899,2548,2553,2878,2891,2897,2902,2908,2913,2918,3321,3326,3331,3365,3511,3517,3522,3527,3878,3883,3888,3893],{"type":33,"tag":34,"props":35,"children":36},"element","p",{},[37],{"type":38,"value":39},"text","Migrating from monolithic e-commerce platforms to headless architecture isn't a one-night \"replatform.\" In 2026, the average e-commerce site handles 50,000+ requests daily, with 40% sourcing from organic search—each second of downtime means $5,000+ in lost revenue. Given these numbers, migration strategy demands engineering discipline: phased rollout, canonical URL preservation, microscopic measurement of add-to-cart flows. This article shares a battle-tested roadmap for headless migration, technical decisions that prevent SEO drop-off, and metrics to keep cart abandonment monitored—all with concrete code examples.",{"type":33,"tag":41,"props":42,"children":44},"h2",{"id":43},"phased-rollout-traffic-segmentation-and-canary-deployment",[45],{"type":38,"value":46},"Phased Rollout: Traffic Segmentation and Canary Deployment",{"type":33,"tag":34,"props":48,"children":49},{},[50],{"type":38,"value":51},"The critical decision in headless migration: which user segment do you route to the new system first? Big-bang deployment carries 100% downtime risk; the correct approach is traffic splitting at the Edge CDN level. With Cloudflare Workers, you can route 5% of new users to the headless frontend while proxying the rest to the legacy stack.",{"type":33,"tag":53,"props":54,"children":58},"pre",{"className":55,"code":56,"language":57,"meta":16,"style":16},"language-javascript shiki shiki-themes github-dark","\u002F\u002F Cloudflare Worker: Phased headless routing\naddEventListener('fetch', event => {\n  event.respondWith(handleRequest(event.request))\n})\n\nasync function handleRequest(request) {\n  const url = new URL(request.url)\n  const userId = request.headers.get('X-User-ID') || Math.random()\n  const rolloutPercent = 5 \u002F\u002F Route 5% to headless\n  \n  const isNewStack = (hashCode(userId) % 100) \u003C rolloutPercent\n  \n  if (isNewStack && url.pathname.startsWith('\u002Fproducts')) {\n    \u002F\u002F Route to headless Nuxt\u002FNext origin\n    return fetch('https:\u002F\u002Fheadless-origin.example.com' + url.pathname, request)\n  } else {\n    \u002F\u002F Route to legacy Shopify Liquid origin\n    return fetch('https:\u002F\u002Flegacy-origin.example.com' + url.pathname, request)\n  }\n}\n\nfunction hashCode(str) {\n  let hash = 0\n  for (let i = 0; i \u003C str.length; i++) {\n    hash = ((hash \u003C\u003C 5) - hash) + str.charCodeAt(i)\n    hash |= 0\n  }\n  return Math.abs(hash)\n}\n","javascript",[59],{"type":33,"tag":60,"props":61,"children":62},"code",{"__ignoreMap":16},[63,75,119,147,156,166,199,234,294,321,330,386,394,437,446,479,497,506,535,544,553,561,588,612,677,737,754,762,785],{"type":33,"tag":64,"props":65,"children":68},"span",{"class":66,"line":67},"line",1,[69],{"type":33,"tag":64,"props":70,"children":72},{"style":71},"--shiki-default:#6A737D",[73],{"type":38,"value":74},"\u002F\u002F Cloudflare Worker: Phased headless routing\n",{"type":33,"tag":64,"props":76,"children":78},{"class":66,"line":77},2,[79,85,91,97,102,108,114],{"type":33,"tag":64,"props":80,"children":82},{"style":81},"--shiki-default:#B392F0",[83],{"type":38,"value":84},"addEventListener",{"type":33,"tag":64,"props":86,"children":88},{"style":87},"--shiki-default:#E1E4E8",[89],{"type":38,"value":90},"(",{"type":33,"tag":64,"props":92,"children":94},{"style":93},"--shiki-default:#9ECBFF",[95],{"type":38,"value":96},"'fetch'",{"type":33,"tag":64,"props":98,"children":99},{"style":87},[100],{"type":38,"value":101},", ",{"type":33,"tag":64,"props":103,"children":105},{"style":104},"--shiki-default:#FFAB70",[106],{"type":38,"value":107},"event",{"type":33,"tag":64,"props":109,"children":111},{"style":110},"--shiki-default:#F97583",[112],{"type":38,"value":113}," =>",{"type":33,"tag":64,"props":115,"children":116},{"style":87},[117],{"type":38,"value":118}," {\n",{"type":33,"tag":64,"props":120,"children":122},{"class":66,"line":121},3,[123,128,133,137,142],{"type":33,"tag":64,"props":124,"children":125},{"style":87},[126],{"type":38,"value":127},"  event.",{"type":33,"tag":64,"props":129,"children":130},{"style":81},[131],{"type":38,"value":132},"respondWith",{"type":33,"tag":64,"props":134,"children":135},{"style":87},[136],{"type":38,"value":90},{"type":33,"tag":64,"props":138,"children":139},{"style":81},[140],{"type":38,"value":141},"handleRequest",{"type":33,"tag":64,"props":143,"children":144},{"style":87},[145],{"type":38,"value":146},"(event.request))\n",{"type":33,"tag":64,"props":148,"children":150},{"class":66,"line":149},4,[151],{"type":33,"tag":64,"props":152,"children":153},{"style":87},[154],{"type":38,"value":155},"})\n",{"type":33,"tag":64,"props":157,"children":159},{"class":66,"line":158},5,[160],{"type":33,"tag":64,"props":161,"children":163},{"emptyLinePlaceholder":162},true,[164],{"type":38,"value":165},"\n",{"type":33,"tag":64,"props":167,"children":169},{"class":66,"line":168},6,[170,175,180,185,189,194],{"type":33,"tag":64,"props":171,"children":172},{"style":110},[173],{"type":38,"value":174},"async",{"type":33,"tag":64,"props":176,"children":177},{"style":110},[178],{"type":38,"value":179}," function",{"type":33,"tag":64,"props":181,"children":182},{"style":81},[183],{"type":38,"value":184}," handleRequest",{"type":33,"tag":64,"props":186,"children":187},{"style":87},[188],{"type":38,"value":90},{"type":33,"tag":64,"props":190,"children":191},{"style":104},[192],{"type":38,"value":193},"request",{"type":33,"tag":64,"props":195,"children":196},{"style":87},[197],{"type":38,"value":198},") {\n",{"type":33,"tag":64,"props":200,"children":202},{"class":66,"line":201},7,[203,208,214,219,224,229],{"type":33,"tag":64,"props":204,"children":205},{"style":110},[206],{"type":38,"value":207},"  const",{"type":33,"tag":64,"props":209,"children":211},{"style":210},"--shiki-default:#79B8FF",[212],{"type":38,"value":213}," url",{"type":33,"tag":64,"props":215,"children":216},{"style":110},[217],{"type":38,"value":218}," =",{"type":33,"tag":64,"props":220,"children":221},{"style":110},[222],{"type":38,"value":223}," new",{"type":33,"tag":64,"props":225,"children":226},{"style":81},[227],{"type":38,"value":228}," URL",{"type":33,"tag":64,"props":230,"children":231},{"style":87},[232],{"type":38,"value":233},"(request.url)\n",{"type":33,"tag":64,"props":235,"children":236},{"class":66,"line":27},[237,241,246,250,255,260,264,269,274,279,284,289],{"type":33,"tag":64,"props":238,"children":239},{"style":110},[240],{"type":38,"value":207},{"type":33,"tag":64,"props":242,"children":243},{"style":210},[244],{"type":38,"value":245}," userId",{"type":33,"tag":64,"props":247,"children":248},{"style":110},[249],{"type":38,"value":218},{"type":33,"tag":64,"props":251,"children":252},{"style":87},[253],{"type":38,"value":254}," request.headers.",{"type":33,"tag":64,"props":256,"children":257},{"style":81},[258],{"type":38,"value":259},"get",{"type":33,"tag":64,"props":261,"children":262},{"style":87},[263],{"type":38,"value":90},{"type":33,"tag":64,"props":265,"children":266},{"style":93},[267],{"type":38,"value":268},"'X-User-ID'",{"type":33,"tag":64,"props":270,"children":271},{"style":87},[272],{"type":38,"value":273},") ",{"type":33,"tag":64,"props":275,"children":276},{"style":110},[277],{"type":38,"value":278},"||",{"type":33,"tag":64,"props":280,"children":281},{"style":87},[282],{"type":38,"value":283}," Math.",{"type":33,"tag":64,"props":285,"children":286},{"style":81},[287],{"type":38,"value":288},"random",{"type":33,"tag":64,"props":290,"children":291},{"style":87},[292],{"type":38,"value":293},"()\n",{"type":33,"tag":64,"props":295,"children":297},{"class":66,"line":296},9,[298,302,307,311,316],{"type":33,"tag":64,"props":299,"children":300},{"style":110},[301],{"type":38,"value":207},{"type":33,"tag":64,"props":303,"children":304},{"style":210},[305],{"type":38,"value":306}," rolloutPercent",{"type":33,"tag":64,"props":308,"children":309},{"style":110},[310],{"type":38,"value":218},{"type":33,"tag":64,"props":312,"children":313},{"style":210},[314],{"type":38,"value":315}," 5",{"type":33,"tag":64,"props":317,"children":318},{"style":71},[319],{"type":38,"value":320}," \u002F\u002F Route 5% to headless\n",{"type":33,"tag":64,"props":322,"children":324},{"class":66,"line":323},10,[325],{"type":33,"tag":64,"props":326,"children":327},{"style":87},[328],{"type":38,"value":329},"  \n",{"type":33,"tag":64,"props":331,"children":333},{"class":66,"line":332},11,[334,338,343,347,352,357,362,367,372,376,381],{"type":33,"tag":64,"props":335,"children":336},{"style":110},[337],{"type":38,"value":207},{"type":33,"tag":64,"props":339,"children":340},{"style":210},[341],{"type":38,"value":342}," isNewStack",{"type":33,"tag":64,"props":344,"children":345},{"style":110},[346],{"type":38,"value":218},{"type":33,"tag":64,"props":348,"children":349},{"style":87},[350],{"type":38,"value":351}," (",{"type":33,"tag":64,"props":353,"children":354},{"style":81},[355],{"type":38,"value":356},"hashCode",{"type":33,"tag":64,"props":358,"children":359},{"style":87},[360],{"type":38,"value":361},"(userId) ",{"type":33,"tag":64,"props":363,"children":364},{"style":110},[365],{"type":38,"value":366},"%",{"type":33,"tag":64,"props":368,"children":369},{"style":210},[370],{"type":38,"value":371}," 100",{"type":33,"tag":64,"props":373,"children":374},{"style":87},[375],{"type":38,"value":273},{"type":33,"tag":64,"props":377,"children":378},{"style":110},[379],{"type":38,"value":380},"\u003C",{"type":33,"tag":64,"props":382,"children":383},{"style":87},[384],{"type":38,"value":385}," rolloutPercent\n",{"type":33,"tag":64,"props":387,"children":389},{"class":66,"line":388},12,[390],{"type":33,"tag":64,"props":391,"children":392},{"style":87},[393],{"type":38,"value":329},{"type":33,"tag":64,"props":395,"children":397},{"class":66,"line":396},13,[398,403,408,413,418,423,427,432],{"type":33,"tag":64,"props":399,"children":400},{"style":110},[401],{"type":38,"value":402},"  if",{"type":33,"tag":64,"props":404,"children":405},{"style":87},[406],{"type":38,"value":407}," (isNewStack ",{"type":33,"tag":64,"props":409,"children":410},{"style":110},[411],{"type":38,"value":412},"&&",{"type":33,"tag":64,"props":414,"children":415},{"style":87},[416],{"type":38,"value":417}," url.pathname.",{"type":33,"tag":64,"props":419,"children":420},{"style":81},[421],{"type":38,"value":422},"startsWith",{"type":33,"tag":64,"props":424,"children":425},{"style":87},[426],{"type":38,"value":90},{"type":33,"tag":64,"props":428,"children":429},{"style":93},[430],{"type":38,"value":431},"'\u002Fproducts'",{"type":33,"tag":64,"props":433,"children":434},{"style":87},[435],{"type":38,"value":436},")) {\n",{"type":33,"tag":64,"props":438,"children":440},{"class":66,"line":439},14,[441],{"type":33,"tag":64,"props":442,"children":443},{"style":71},[444],{"type":38,"value":445},"    \u002F\u002F Route to headless Nuxt\u002FNext origin\n",{"type":33,"tag":64,"props":447,"children":449},{"class":66,"line":448},15,[450,455,460,464,469,474],{"type":33,"tag":64,"props":451,"children":452},{"style":110},[453],{"type":38,"value":454},"    return",{"type":33,"tag":64,"props":456,"children":457},{"style":81},[458],{"type":38,"value":459}," fetch",{"type":33,"tag":64,"props":461,"children":462},{"style":87},[463],{"type":38,"value":90},{"type":33,"tag":64,"props":465,"children":466},{"style":93},[467],{"type":38,"value":468},"'https:\u002F\u002Fheadless-origin.example.com'",{"type":33,"tag":64,"props":470,"children":471},{"style":110},[472],{"type":38,"value":473}," +",{"type":33,"tag":64,"props":475,"children":476},{"style":87},[477],{"type":38,"value":478}," url.pathname, request)\n",{"type":33,"tag":64,"props":480,"children":482},{"class":66,"line":481},16,[483,488,493],{"type":33,"tag":64,"props":484,"children":485},{"style":87},[486],{"type":38,"value":487},"  } ",{"type":33,"tag":64,"props":489,"children":490},{"style":110},[491],{"type":38,"value":492},"else",{"type":33,"tag":64,"props":494,"children":495},{"style":87},[496],{"type":38,"value":118},{"type":33,"tag":64,"props":498,"children":500},{"class":66,"line":499},17,[501],{"type":33,"tag":64,"props":502,"children":503},{"style":71},[504],{"type":38,"value":505},"    \u002F\u002F Route to legacy Shopify Liquid origin\n",{"type":33,"tag":64,"props":507,"children":509},{"class":66,"line":508},18,[510,514,518,522,527,531],{"type":33,"tag":64,"props":511,"children":512},{"style":110},[513],{"type":38,"value":454},{"type":33,"tag":64,"props":515,"children":516},{"style":81},[517],{"type":38,"value":459},{"type":33,"tag":64,"props":519,"children":520},{"style":87},[521],{"type":38,"value":90},{"type":33,"tag":64,"props":523,"children":524},{"style":93},[525],{"type":38,"value":526},"'https:\u002F\u002Flegacy-origin.example.com'",{"type":33,"tag":64,"props":528,"children":529},{"style":110},[530],{"type":38,"value":473},{"type":33,"tag":64,"props":532,"children":533},{"style":87},[534],{"type":38,"value":478},{"type":33,"tag":64,"props":536,"children":538},{"class":66,"line":537},19,[539],{"type":33,"tag":64,"props":540,"children":541},{"style":87},[542],{"type":38,"value":543},"  }\n",{"type":33,"tag":64,"props":545,"children":547},{"class":66,"line":546},20,[548],{"type":33,"tag":64,"props":549,"children":550},{"style":87},[551],{"type":38,"value":552},"}\n",{"type":33,"tag":64,"props":554,"children":556},{"class":66,"line":555},21,[557],{"type":33,"tag":64,"props":558,"children":559},{"emptyLinePlaceholder":162},[560],{"type":38,"value":165},{"type":33,"tag":64,"props":562,"children":564},{"class":66,"line":563},22,[565,570,575,579,584],{"type":33,"tag":64,"props":566,"children":567},{"style":110},[568],{"type":38,"value":569},"function",{"type":33,"tag":64,"props":571,"children":572},{"style":81},[573],{"type":38,"value":574}," hashCode",{"type":33,"tag":64,"props":576,"children":577},{"style":87},[578],{"type":38,"value":90},{"type":33,"tag":64,"props":580,"children":581},{"style":104},[582],{"type":38,"value":583},"str",{"type":33,"tag":64,"props":585,"children":586},{"style":87},[587],{"type":38,"value":198},{"type":33,"tag":64,"props":589,"children":591},{"class":66,"line":590},23,[592,597,602,607],{"type":33,"tag":64,"props":593,"children":594},{"style":110},[595],{"type":38,"value":596},"  let",{"type":33,"tag":64,"props":598,"children":599},{"style":87},[600],{"type":38,"value":601}," hash ",{"type":33,"tag":64,"props":603,"children":604},{"style":110},[605],{"type":38,"value":606},"=",{"type":33,"tag":64,"props":608,"children":609},{"style":210},[610],{"type":38,"value":611}," 0\n",{"type":33,"tag":64,"props":613,"children":615},{"class":66,"line":614},24,[616,621,625,630,635,639,644,649,653,658,663,668,673],{"type":33,"tag":64,"props":617,"children":618},{"style":110},[619],{"type":38,"value":620},"  for",{"type":33,"tag":64,"props":622,"children":623},{"style":87},[624],{"type":38,"value":351},{"type":33,"tag":64,"props":626,"children":627},{"style":110},[628],{"type":38,"value":629},"let",{"type":33,"tag":64,"props":631,"children":632},{"style":87},[633],{"type":38,"value":634}," i ",{"type":33,"tag":64,"props":636,"children":637},{"style":110},[638],{"type":38,"value":606},{"type":33,"tag":64,"props":640,"children":641},{"style":210},[642],{"type":38,"value":643}," 0",{"type":33,"tag":64,"props":645,"children":646},{"style":87},[647],{"type":38,"value":648},"; i ",{"type":33,"tag":64,"props":650,"children":651},{"style":110},[652],{"type":38,"value":380},{"type":33,"tag":64,"props":654,"children":655},{"style":87},[656],{"type":38,"value":657}," str.",{"type":33,"tag":64,"props":659,"children":660},{"style":210},[661],{"type":38,"value":662},"length",{"type":33,"tag":64,"props":664,"children":665},{"style":87},[666],{"type":38,"value":667},"; i",{"type":33,"tag":64,"props":669,"children":670},{"style":110},[671],{"type":38,"value":672},"++",{"type":33,"tag":64,"props":674,"children":675},{"style":87},[676],{"type":38,"value":198},{"type":33,"tag":64,"props":678,"children":680},{"class":66,"line":679},25,[681,686,690,695,700,704,708,713,718,723,727,732],{"type":33,"tag":64,"props":682,"children":683},{"style":87},[684],{"type":38,"value":685},"    hash ",{"type":33,"tag":64,"props":687,"children":688},{"style":110},[689],{"type":38,"value":606},{"type":33,"tag":64,"props":691,"children":692},{"style":87},[693],{"type":38,"value":694}," ((hash ",{"type":33,"tag":64,"props":696,"children":697},{"style":110},[698],{"type":38,"value":699},"\u003C\u003C",{"type":33,"tag":64,"props":701,"children":702},{"style":210},[703],{"type":38,"value":315},{"type":33,"tag":64,"props":705,"children":706},{"style":87},[707],{"type":38,"value":273},{"type":33,"tag":64,"props":709,"children":710},{"style":110},[711],{"type":38,"value":712},"-",{"type":33,"tag":64,"props":714,"children":715},{"style":87},[716],{"type":38,"value":717}," hash) ",{"type":33,"tag":64,"props":719,"children":720},{"style":110},[721],{"type":38,"value":722},"+",{"type":33,"tag":64,"props":724,"children":725},{"style":87},[726],{"type":38,"value":657},{"type":33,"tag":64,"props":728,"children":729},{"style":81},[730],{"type":38,"value":731},"charCodeAt",{"type":33,"tag":64,"props":733,"children":734},{"style":87},[735],{"type":38,"value":736},"(i)\n",{"type":33,"tag":64,"props":738,"children":740},{"class":66,"line":739},26,[741,745,750],{"type":33,"tag":64,"props":742,"children":743},{"style":87},[744],{"type":38,"value":685},{"type":33,"tag":64,"props":746,"children":747},{"style":110},[748],{"type":38,"value":749},"|=",{"type":33,"tag":64,"props":751,"children":752},{"style":210},[753],{"type":38,"value":611},{"type":33,"tag":64,"props":755,"children":757},{"class":66,"line":756},27,[758],{"type":33,"tag":64,"props":759,"children":760},{"style":87},[761],{"type":38,"value":543},{"type":33,"tag":64,"props":763,"children":765},{"class":66,"line":764},28,[766,771,775,780],{"type":33,"tag":64,"props":767,"children":768},{"style":110},[769],{"type":38,"value":770},"  return",{"type":33,"tag":64,"props":772,"children":773},{"style":87},[774],{"type":38,"value":283},{"type":33,"tag":64,"props":776,"children":777},{"style":81},[778],{"type":38,"value":779},"abs",{"type":33,"tag":64,"props":781,"children":782},{"style":87},[783],{"type":38,"value":784},"(hash)\n",{"type":33,"tag":64,"props":786,"children":788},{"class":66,"line":787},29,[789],{"type":33,"tag":64,"props":790,"children":791},{"style":87},[792],{"type":38,"value":552},{"type":33,"tag":34,"props":794,"children":795},{},[796,798,804],{"type":38,"value":797},"In this approach, you incrementally increase ",{"type":33,"tag":60,"props":799,"children":801},{"className":800},[],[802],{"type":38,"value":803},"rolloutPercent",{"type":38,"value":805},": 5% → 25% → 50% → 100%. At each stage, wait 72 hours and check for metric anomalies before advancing. Watch critical metrics: if Largest Contentful Paint (LCP) was 2.3s on the legacy stack, it should hit 1.8s on headless; if add-to-cart success rate drops below 99.2%, roll back immediately.",{"type":33,"tag":34,"props":807,"children":808},{},[809,811,817],{"type":38,"value":810},"The second dimension of phased rollout is geographic segmentation: start in low-traffic regions (e.g., Central Europe) before progressing to core markets like the US and Turkey. Use Cloudflare's ",{"type":33,"tag":60,"props":812,"children":814},{"className":813},[],[815],{"type":38,"value":816},"request.cf.country",{"type":38,"value":818}," header for country-based routing.",{"type":33,"tag":820,"props":821,"children":823},"h3",{"id":822},"canary-deployment-and-automatic-rollback",[824],{"type":38,"value":825},"Canary Deployment and Automatic Rollback",{"type":33,"tag":34,"props":827,"children":828},{},[829],{"type":38,"value":830},"Build automatic rollback into your deployment pipeline. If using Vercel or Netlify, add custom health checks to your deployment hook:",{"type":33,"tag":53,"props":832,"children":836},{"className":833,"code":834,"language":835,"meta":16,"style":16},"language-yaml shiki shiki-themes github-dark","# .github\u002Fworkflows\u002Fdeploy-headless.yml\n- name: Deploy to production\n  run: vercel --prod\n  \n- name: Health check (30s probe)\n  run: |\n    for i in {1..6}; do\n      STATUS=$(curl -s -o \u002Fdev\u002Fnull -w \"%{http_code}\" https:\u002F\u002Fheadless-origin.example.com\u002Fapi\u002Fhealth)\n      if [ $STATUS -ne 200 ]; then\n        echo \"Health check failed, rolling back\"\n        vercel rollback\n        exit 1\n      fi\n      sleep 5\n    done\n","yaml",[837],{"type":33,"tag":60,"props":838,"children":839},{"__ignoreMap":16},[840,848,872,889,896,916,932,940,948,956,964,972,980,988,996],{"type":33,"tag":64,"props":841,"children":842},{"class":66,"line":67},[843],{"type":33,"tag":64,"props":844,"children":845},{"style":71},[846],{"type":38,"value":847},"# .github\u002Fworkflows\u002Fdeploy-headless.yml\n",{"type":33,"tag":64,"props":849,"children":850},{"class":66,"line":77},[851,856,862,867],{"type":33,"tag":64,"props":852,"children":853},{"style":87},[854],{"type":38,"value":855},"- ",{"type":33,"tag":64,"props":857,"children":859},{"style":858},"--shiki-default:#85E89D",[860],{"type":38,"value":861},"name",{"type":33,"tag":64,"props":863,"children":864},{"style":87},[865],{"type":38,"value":866},": ",{"type":33,"tag":64,"props":868,"children":869},{"style":93},[870],{"type":38,"value":871},"Deploy to production\n",{"type":33,"tag":64,"props":873,"children":874},{"class":66,"line":121},[875,880,884],{"type":33,"tag":64,"props":876,"children":877},{"style":858},[878],{"type":38,"value":879},"  run",{"type":33,"tag":64,"props":881,"children":882},{"style":87},[883],{"type":38,"value":866},{"type":33,"tag":64,"props":885,"children":886},{"style":93},[887],{"type":38,"value":888},"vercel --prod\n",{"type":33,"tag":64,"props":890,"children":891},{"class":66,"line":149},[892],{"type":33,"tag":64,"props":893,"children":894},{"style":87},[895],{"type":38,"value":329},{"type":33,"tag":64,"props":897,"children":898},{"class":66,"line":158},[899,903,907,911],{"type":33,"tag":64,"props":900,"children":901},{"style":87},[902],{"type":38,"value":855},{"type":33,"tag":64,"props":904,"children":905},{"style":858},[906],{"type":38,"value":861},{"type":33,"tag":64,"props":908,"children":909},{"style":87},[910],{"type":38,"value":866},{"type":33,"tag":64,"props":912,"children":913},{"style":93},[914],{"type":38,"value":915},"Health check (30s probe)\n",{"type":33,"tag":64,"props":917,"children":918},{"class":66,"line":168},[919,923,927],{"type":33,"tag":64,"props":920,"children":921},{"style":858},[922],{"type":38,"value":879},{"type":33,"tag":64,"props":924,"children":925},{"style":87},[926],{"type":38,"value":866},{"type":33,"tag":64,"props":928,"children":929},{"style":110},[930],{"type":38,"value":931},"|\n",{"type":33,"tag":64,"props":933,"children":934},{"class":66,"line":201},[935],{"type":33,"tag":64,"props":936,"children":937},{"style":93},[938],{"type":38,"value":939},"    for i in {1..6}; do\n",{"type":33,"tag":64,"props":941,"children":942},{"class":66,"line":27},[943],{"type":33,"tag":64,"props":944,"children":945},{"style":93},[946],{"type":38,"value":947},"      STATUS=$(curl -s -o \u002Fdev\u002Fnull -w \"%{http_code}\" https:\u002F\u002Fheadless-origin.example.com\u002Fapi\u002Fhealth)\n",{"type":33,"tag":64,"props":949,"children":950},{"class":66,"line":296},[951],{"type":33,"tag":64,"props":952,"children":953},{"style":93},[954],{"type":38,"value":955},"      if [ $STATUS -ne 200 ]; then\n",{"type":33,"tag":64,"props":957,"children":958},{"class":66,"line":323},[959],{"type":33,"tag":64,"props":960,"children":961},{"style":93},[962],{"type":38,"value":963},"        echo \"Health check failed, rolling back\"\n",{"type":33,"tag":64,"props":965,"children":966},{"class":66,"line":332},[967],{"type":33,"tag":64,"props":968,"children":969},{"style":93},[970],{"type":38,"value":971},"        vercel rollback\n",{"type":33,"tag":64,"props":973,"children":974},{"class":66,"line":388},[975],{"type":33,"tag":64,"props":976,"children":977},{"style":93},[978],{"type":38,"value":979},"        exit 1\n",{"type":33,"tag":64,"props":981,"children":982},{"class":66,"line":396},[983],{"type":33,"tag":64,"props":984,"children":985},{"style":93},[986],{"type":38,"value":987},"      fi\n",{"type":33,"tag":64,"props":989,"children":990},{"class":66,"line":439},[991],{"type":33,"tag":64,"props":992,"children":993},{"style":93},[994],{"type":38,"value":995},"      sleep 5\n",{"type":33,"tag":64,"props":997,"children":998},{"class":66,"line":448},[999],{"type":33,"tag":64,"props":1000,"children":1001},{"style":93},[1002],{"type":38,"value":1003},"    done\n",{"type":33,"tag":34,"props":1005,"children":1006},{},[1007],{"type":38,"value":1008},"Your health check endpoint must test critical systems: database connection pool, cache hit rate, payment gateway ping. Without 100% success within 30 seconds, deployment rolls back automatically.",{"type":33,"tag":41,"props":1010,"children":1012},{"id":1011},"seo-preservation-canonical-urls-and-structured-data-protection",[1013],{"type":38,"value":1014},"SEO Preservation: Canonical URLs and Structured Data Protection",{"type":33,"tag":34,"props":1016,"children":1017},{},[1018],{"type":38,"value":1019},"The biggest fear in headless migration is organic traffic collapse. According to Google's 2025 Merchant Center data, 68% of e-commerce sites experience 15%+ organic traffic drop in the first 90 days post-replatform. This stems from broken canonical URLs, lost structured data, and poorly configured redirect chains.",{"type":33,"tag":34,"props":1021,"children":1022},{},[1023],{"type":38,"value":1024},"First, map old and new system URLs 1:1. If migrating from Shopify to Next.js:",{"type":33,"tag":1026,"props":1027,"children":1028},"table",{},[1029,1053],{"type":33,"tag":1030,"props":1031,"children":1032},"thead",{},[1033],{"type":33,"tag":1034,"props":1035,"children":1036},"tr",{},[1037,1043,1048],{"type":33,"tag":1038,"props":1039,"children":1040},"th",{},[1041],{"type":38,"value":1042},"Legacy (Shopify Liquid)",{"type":33,"tag":1038,"props":1044,"children":1045},{},[1046],{"type":38,"value":1047},"New (Next.js)",{"type":33,"tag":1038,"props":1049,"children":1050},{},[1051],{"type":38,"value":1052},"Status",{"type":33,"tag":1054,"props":1055,"children":1056},"tbody",{},[1057,1083,1109],{"type":33,"tag":1034,"props":1058,"children":1059},{},[1060,1070,1078],{"type":33,"tag":1061,"props":1062,"children":1063},"td",{},[1064],{"type":33,"tag":60,"props":1065,"children":1067},{"className":1066},[],[1068],{"type":38,"value":1069},"\u002Fproducts\u002Fwireless-headphones",{"type":33,"tag":1061,"props":1071,"children":1072},{},[1073],{"type":33,"tag":60,"props":1074,"children":1076},{"className":1075},[],[1077],{"type":38,"value":1069},{"type":33,"tag":1061,"props":1079,"children":1080},{},[1081],{"type":38,"value":1082},"✅ Same slug",{"type":33,"tag":1034,"props":1084,"children":1085},{},[1086,1095,1104],{"type":33,"tag":1061,"props":1087,"children":1088},{},[1089],{"type":33,"tag":60,"props":1090,"children":1092},{"className":1091},[],[1093],{"type":38,"value":1094},"\u002Fcollections\u002Felectronics",{"type":33,"tag":1061,"props":1096,"children":1097},{},[1098],{"type":33,"tag":60,"props":1099,"children":1101},{"className":1100},[],[1102],{"type":38,"value":1103},"\u002Fcategories\u002Felectronics",{"type":33,"tag":1061,"props":1105,"children":1106},{},[1107],{"type":38,"value":1108},"❌ Path changed—301 redirect required",{"type":33,"tag":1034,"props":1110,"children":1111},{},[1112,1121,1130],{"type":33,"tag":1061,"props":1113,"children":1114},{},[1115],{"type":33,"tag":60,"props":1116,"children":1118},{"className":1117},[],[1119],{"type":38,"value":1120},"\u002Fpages\u002Fabout",{"type":33,"tag":1061,"props":1122,"children":1123},{},[1124],{"type":33,"tag":60,"props":1125,"children":1127},{"className":1126},[],[1128],{"type":38,"value":1129},"\u002Fabout",{"type":33,"tag":1061,"props":1131,"children":1132},{},[1133],{"type":38,"value":1134},"⚠️ Path shortened—add canonical tag",{"type":33,"tag":34,"props":1136,"children":1137},{},[1138],{"type":38,"value":1139},"For necessary path changes, set up 301 redirects at the Edge. Cloudflare Workers example:",{"type":33,"tag":53,"props":1141,"children":1143},{"className":55,"code":1142,"language":57,"meta":16,"style":16},"const REDIRECT_MAP = {\n  '\u002Fcollections\u002Felectronics': '\u002Fcategories\u002Felectronics',\n  '\u002Fpages\u002Fabout': '\u002Fabout'\n}\n\naddEventListener('fetch', event => {\n  const url = new URL(event.request.url)\n  const newPath = REDIRECT_MAP[url.pathname]\n  \n  if (newPath) {\n    return Response.redirect(url.origin + newPath, 301)\n  }\n  \n  event.respondWith(fetch(event.request))\n})\n",[1144],{"type":33,"tag":60,"props":1145,"children":1146},{"__ignoreMap":16},[1147,1168,1190,1207,1214,1221,1252,1280,1305,1312,1324,1365,1372,1379,1403],{"type":33,"tag":64,"props":1148,"children":1149},{"class":66,"line":67},[1150,1155,1160,1164],{"type":33,"tag":64,"props":1151,"children":1152},{"style":110},[1153],{"type":38,"value":1154},"const",{"type":33,"tag":64,"props":1156,"children":1157},{"style":210},[1158],{"type":38,"value":1159}," REDIRECT_MAP",{"type":33,"tag":64,"props":1161,"children":1162},{"style":110},[1163],{"type":38,"value":218},{"type":33,"tag":64,"props":1165,"children":1166},{"style":87},[1167],{"type":38,"value":118},{"type":33,"tag":64,"props":1169,"children":1170},{"class":66,"line":77},[1171,1176,1180,1185],{"type":33,"tag":64,"props":1172,"children":1173},{"style":93},[1174],{"type":38,"value":1175},"  '\u002Fcollections\u002Felectronics'",{"type":33,"tag":64,"props":1177,"children":1178},{"style":87},[1179],{"type":38,"value":866},{"type":33,"tag":64,"props":1181,"children":1182},{"style":93},[1183],{"type":38,"value":1184},"'\u002Fcategories\u002Felectronics'",{"type":33,"tag":64,"props":1186,"children":1187},{"style":87},[1188],{"type":38,"value":1189},",\n",{"type":33,"tag":64,"props":1191,"children":1192},{"class":66,"line":121},[1193,1198,1202],{"type":33,"tag":64,"props":1194,"children":1195},{"style":93},[1196],{"type":38,"value":1197},"  '\u002Fpages\u002Fabout'",{"type":33,"tag":64,"props":1199,"children":1200},{"style":87},[1201],{"type":38,"value":866},{"type":33,"tag":64,"props":1203,"children":1204},{"style":93},[1205],{"type":38,"value":1206},"'\u002Fabout'\n",{"type":33,"tag":64,"props":1208,"children":1209},{"class":66,"line":149},[1210],{"type":33,"tag":64,"props":1211,"children":1212},{"style":87},[1213],{"type":38,"value":552},{"type":33,"tag":64,"props":1215,"children":1216},{"class":66,"line":158},[1217],{"type":33,"tag":64,"props":1218,"children":1219},{"emptyLinePlaceholder":162},[1220],{"type":38,"value":165},{"type":33,"tag":64,"props":1222,"children":1223},{"class":66,"line":168},[1224,1228,1232,1236,1240,1244,1248],{"type":33,"tag":64,"props":1225,"children":1226},{"style":81},[1227],{"type":38,"value":84},{"type":33,"tag":64,"props":1229,"children":1230},{"style":87},[1231],{"type":38,"value":90},{"type":33,"tag":64,"props":1233,"children":1234},{"style":93},[1235],{"type":38,"value":96},{"type":33,"tag":64,"props":1237,"children":1238},{"style":87},[1239],{"type":38,"value":101},{"type":33,"tag":64,"props":1241,"children":1242},{"style":104},[1243],{"type":38,"value":107},{"type":33,"tag":64,"props":1245,"children":1246},{"style":110},[1247],{"type":38,"value":113},{"type":33,"tag":64,"props":1249,"children":1250},{"style":87},[1251],{"type":38,"value":118},{"type":33,"tag":64,"props":1253,"children":1254},{"class":66,"line":201},[1255,1259,1263,1267,1271,1275],{"type":33,"tag":64,"props":1256,"children":1257},{"style":110},[1258],{"type":38,"value":207},{"type":33,"tag":64,"props":1260,"children":1261},{"style":210},[1262],{"type":38,"value":213},{"type":33,"tag":64,"props":1264,"children":1265},{"style":110},[1266],{"type":38,"value":218},{"type":33,"tag":64,"props":1268,"children":1269},{"style":110},[1270],{"type":38,"value":223},{"type":33,"tag":64,"props":1272,"children":1273},{"style":81},[1274],{"type":38,"value":228},{"type":33,"tag":64,"props":1276,"children":1277},{"style":87},[1278],{"type":38,"value":1279},"(event.request.url)\n",{"type":33,"tag":64,"props":1281,"children":1282},{"class":66,"line":27},[1283,1287,1292,1296,1300],{"type":33,"tag":64,"props":1284,"children":1285},{"style":110},[1286],{"type":38,"value":207},{"type":33,"tag":64,"props":1288,"children":1289},{"style":210},[1290],{"type":38,"value":1291}," newPath",{"type":33,"tag":64,"props":1293,"children":1294},{"style":110},[1295],{"type":38,"value":218},{"type":33,"tag":64,"props":1297,"children":1298},{"style":210},[1299],{"type":38,"value":1159},{"type":33,"tag":64,"props":1301,"children":1302},{"style":87},[1303],{"type":38,"value":1304},"[url.pathname]\n",{"type":33,"tag":64,"props":1306,"children":1307},{"class":66,"line":296},[1308],{"type":33,"tag":64,"props":1309,"children":1310},{"style":87},[1311],{"type":38,"value":329},{"type":33,"tag":64,"props":1313,"children":1314},{"class":66,"line":323},[1315,1319],{"type":33,"tag":64,"props":1316,"children":1317},{"style":110},[1318],{"type":38,"value":402},{"type":33,"tag":64,"props":1320,"children":1321},{"style":87},[1322],{"type":38,"value":1323}," (newPath) {\n",{"type":33,"tag":64,"props":1325,"children":1326},{"class":66,"line":332},[1327,1331,1336,1341,1346,1350,1355,1360],{"type":33,"tag":64,"props":1328,"children":1329},{"style":110},[1330],{"type":38,"value":454},{"type":33,"tag":64,"props":1332,"children":1333},{"style":87},[1334],{"type":38,"value":1335}," Response.",{"type":33,"tag":64,"props":1337,"children":1338},{"style":81},[1339],{"type":38,"value":1340},"redirect",{"type":33,"tag":64,"props":1342,"children":1343},{"style":87},[1344],{"type":38,"value":1345},"(url.origin ",{"type":33,"tag":64,"props":1347,"children":1348},{"style":110},[1349],{"type":38,"value":722},{"type":33,"tag":64,"props":1351,"children":1352},{"style":87},[1353],{"type":38,"value":1354}," newPath, ",{"type":33,"tag":64,"props":1356,"children":1357},{"style":210},[1358],{"type":38,"value":1359},"301",{"type":33,"tag":64,"props":1361,"children":1362},{"style":87},[1363],{"type":38,"value":1364},")\n",{"type":33,"tag":64,"props":1366,"children":1367},{"class":66,"line":388},[1368],{"type":33,"tag":64,"props":1369,"children":1370},{"style":87},[1371],{"type":38,"value":543},{"type":33,"tag":64,"props":1373,"children":1374},{"class":66,"line":396},[1375],{"type":33,"tag":64,"props":1376,"children":1377},{"style":87},[1378],{"type":38,"value":329},{"type":33,"tag":64,"props":1380,"children":1381},{"class":66,"line":439},[1382,1386,1390,1394,1399],{"type":33,"tag":64,"props":1383,"children":1384},{"style":87},[1385],{"type":38,"value":127},{"type":33,"tag":64,"props":1387,"children":1388},{"style":81},[1389],{"type":38,"value":132},{"type":33,"tag":64,"props":1391,"children":1392},{"style":87},[1393],{"type":38,"value":90},{"type":33,"tag":64,"props":1395,"children":1396},{"style":81},[1397],{"type":38,"value":1398},"fetch",{"type":33,"tag":64,"props":1400,"children":1401},{"style":87},[1402],{"type":38,"value":146},{"type":33,"tag":64,"props":1404,"children":1405},{"class":66,"line":448},[1406],{"type":33,"tag":64,"props":1407,"children":1408},{"style":87},[1409],{"type":38,"value":155},{"type":33,"tag":34,"props":1411,"children":1412},{},[1413,1415,1421,1423,1429],{"type":38,"value":1414},"Audit your structured data: if Product, BreadcrumbList, and Organization schemas exist in the legacy system, they must render identically in the new one. On Next.js, skip ",{"type":33,"tag":60,"props":1416,"children":1418},{"className":1417},[],[1419],{"type":38,"value":1420},"next-seo",{"type":38,"value":1422}," and use manual ",{"type":33,"tag":60,"props":1424,"children":1426},{"className":1425},[],[1427],{"type":38,"value":1428},"\u003Cscript type=\"application\u002Fld+json\">",{"type":38,"value":1430}," for guaranteed rendering:",{"type":33,"tag":53,"props":1432,"children":1436},{"className":1433,"code":1434,"language":1435,"meta":16,"style":16},"language-jsx shiki shiki-themes github-dark","\u002F\u002F app\u002Fproducts\u002F[slug]\u002Fpage.tsx\nexport default function ProductPage({ product }) {\n  const structuredData = {\n    \"@context\": \"https:\u002F\u002Fschema.org\",\n    \"@type\": \"Product\",\n    \"name\": product.title,\n    \"sku\": product.sku,\n    \"offers\": {\n      \"@type\": \"Offer\",\n      \"price\": product.price,\n      \"priceCurrency\": \"USD\",\n      \"availability\": product.stock > 0 ? \"InStock\" : \"OutOfStock\"\n    }\n  }\n  \n  return (\n    \u003C>\n      \u003Cscript\n        type=\"application\u002Fld+json\"\n        dangerouslySetInnerHTML={{ __html: JSON.stringify(structuredData) }}\n      \u002F>\n      {\u002F* Product render *\u002F}\n    \u003C\u002F>\n  )\n}\n","jsx",[1437],{"type":33,"tag":60,"props":1438,"children":1439},{"__ignoreMap":16},[1440,1448,1485,1505,1526,1547,1560,1573,1586,1607,1620,1641,1683,1691,1698,1705,1717,1725,1738,1755,1792,1800,1817,1825,1833],{"type":33,"tag":64,"props":1441,"children":1442},{"class":66,"line":67},[1443],{"type":33,"tag":64,"props":1444,"children":1445},{"style":71},[1446],{"type":38,"value":1447},"\u002F\u002F app\u002Fproducts\u002F[slug]\u002Fpage.tsx\n",{"type":33,"tag":64,"props":1449,"children":1450},{"class":66,"line":77},[1451,1456,1461,1465,1470,1475,1480],{"type":33,"tag":64,"props":1452,"children":1453},{"style":110},[1454],{"type":38,"value":1455},"export",{"type":33,"tag":64,"props":1457,"children":1458},{"style":110},[1459],{"type":38,"value":1460}," default",{"type":33,"tag":64,"props":1462,"children":1463},{"style":110},[1464],{"type":38,"value":179},{"type":33,"tag":64,"props":1466,"children":1467},{"style":81},[1468],{"type":38,"value":1469}," ProductPage",{"type":33,"tag":64,"props":1471,"children":1472},{"style":87},[1473],{"type":38,"value":1474},"({ ",{"type":33,"tag":64,"props":1476,"children":1477},{"style":104},[1478],{"type":38,"value":1479},"product",{"type":33,"tag":64,"props":1481,"children":1482},{"style":87},[1483],{"type":38,"value":1484}," }) {\n",{"type":33,"tag":64,"props":1486,"children":1487},{"class":66,"line":121},[1488,1492,1497,1501],{"type":33,"tag":64,"props":1489,"children":1490},{"style":110},[1491],{"type":38,"value":207},{"type":33,"tag":64,"props":1493,"children":1494},{"style":210},[1495],{"type":38,"value":1496}," structuredData",{"type":33,"tag":64,"props":1498,"children":1499},{"style":110},[1500],{"type":38,"value":218},{"type":33,"tag":64,"props":1502,"children":1503},{"style":87},[1504],{"type":38,"value":118},{"type":33,"tag":64,"props":1506,"children":1507},{"class":66,"line":149},[1508,1513,1517,1522],{"type":33,"tag":64,"props":1509,"children":1510},{"style":93},[1511],{"type":38,"value":1512},"    \"@context\"",{"type":33,"tag":64,"props":1514,"children":1515},{"style":87},[1516],{"type":38,"value":866},{"type":33,"tag":64,"props":1518,"children":1519},{"style":93},[1520],{"type":38,"value":1521},"\"https:\u002F\u002Fschema.org\"",{"type":33,"tag":64,"props":1523,"children":1524},{"style":87},[1525],{"type":38,"value":1189},{"type":33,"tag":64,"props":1527,"children":1528},{"class":66,"line":158},[1529,1534,1538,1543],{"type":33,"tag":64,"props":1530,"children":1531},{"style":93},[1532],{"type":38,"value":1533},"    \"@type\"",{"type":33,"tag":64,"props":1535,"children":1536},{"style":87},[1537],{"type":38,"value":866},{"type":33,"tag":64,"props":1539,"children":1540},{"style":93},[1541],{"type":38,"value":1542},"\"Product\"",{"type":33,"tag":64,"props":1544,"children":1545},{"style":87},[1546],{"type":38,"value":1189},{"type":33,"tag":64,"props":1548,"children":1549},{"class":66,"line":168},[1550,1555],{"type":33,"tag":64,"props":1551,"children":1552},{"style":93},[1553],{"type":38,"value":1554},"    \"name\"",{"type":33,"tag":64,"props":1556,"children":1557},{"style":87},[1558],{"type":38,"value":1559},": product.title,\n",{"type":33,"tag":64,"props":1561,"children":1562},{"class":66,"line":201},[1563,1568],{"type":33,"tag":64,"props":1564,"children":1565},{"style":93},[1566],{"type":38,"value":1567},"    \"sku\"",{"type":33,"tag":64,"props":1569,"children":1570},{"style":87},[1571],{"type":38,"value":1572},": product.sku,\n",{"type":33,"tag":64,"props":1574,"children":1575},{"class":66,"line":27},[1576,1581],{"type":33,"tag":64,"props":1577,"children":1578},{"style":93},[1579],{"type":38,"value":1580},"    \"offers\"",{"type":33,"tag":64,"props":1582,"children":1583},{"style":87},[1584],{"type":38,"value":1585},": {\n",{"type":33,"tag":64,"props":1587,"children":1588},{"class":66,"line":296},[1589,1594,1598,1603],{"type":33,"tag":64,"props":1590,"children":1591},{"style":93},[1592],{"type":38,"value":1593},"      \"@type\"",{"type":33,"tag":64,"props":1595,"children":1596},{"style":87},[1597],{"type":38,"value":866},{"type":33,"tag":64,"props":1599,"children":1600},{"style":93},[1601],{"type":38,"value":1602},"\"Offer\"",{"type":33,"tag":64,"props":1604,"children":1605},{"style":87},[1606],{"type":38,"value":1189},{"type":33,"tag":64,"props":1608,"children":1609},{"class":66,"line":323},[1610,1615],{"type":33,"tag":64,"props":1611,"children":1612},{"style":93},[1613],{"type":38,"value":1614},"      \"price\"",{"type":33,"tag":64,"props":1616,"children":1617},{"style":87},[1618],{"type":38,"value":1619},": product.price,\n",{"type":33,"tag":64,"props":1621,"children":1622},{"class":66,"line":332},[1623,1628,1632,1637],{"type":33,"tag":64,"props":1624,"children":1625},{"style":93},[1626],{"type":38,"value":1627},"      \"priceCurrency\"",{"type":33,"tag":64,"props":1629,"children":1630},{"style":87},[1631],{"type":38,"value":866},{"type":33,"tag":64,"props":1633,"children":1634},{"style":93},[1635],{"type":38,"value":1636},"\"USD\"",{"type":33,"tag":64,"props":1638,"children":1639},{"style":87},[1640],{"type":38,"value":1189},{"type":33,"tag":64,"props":1642,"children":1643},{"class":66,"line":388},[1644,1649,1654,1659,1663,1668,1673,1678],{"type":33,"tag":64,"props":1645,"children":1646},{"style":93},[1647],{"type":38,"value":1648},"      \"availability\"",{"type":33,"tag":64,"props":1650,"children":1651},{"style":87},[1652],{"type":38,"value":1653},": product.stock ",{"type":33,"tag":64,"props":1655,"children":1656},{"style":110},[1657],{"type":38,"value":1658},">",{"type":33,"tag":64,"props":1660,"children":1661},{"style":210},[1662],{"type":38,"value":643},{"type":33,"tag":64,"props":1664,"children":1665},{"style":110},[1666],{"type":38,"value":1667}," ?",{"type":33,"tag":64,"props":1669,"children":1670},{"style":93},[1671],{"type":38,"value":1672}," \"InStock\"",{"type":33,"tag":64,"props":1674,"children":1675},{"style":110},[1676],{"type":38,"value":1677}," :",{"type":33,"tag":64,"props":1679,"children":1680},{"style":93},[1681],{"type":38,"value":1682}," \"OutOfStock\"\n",{"type":33,"tag":64,"props":1684,"children":1685},{"class":66,"line":396},[1686],{"type":33,"tag":64,"props":1687,"children":1688},{"style":87},[1689],{"type":38,"value":1690},"    }\n",{"type":33,"tag":64,"props":1692,"children":1693},{"class":66,"line":439},[1694],{"type":33,"tag":64,"props":1695,"children":1696},{"style":87},[1697],{"type":38,"value":543},{"type":33,"tag":64,"props":1699,"children":1700},{"class":66,"line":448},[1701],{"type":33,"tag":64,"props":1702,"children":1703},{"style":87},[1704],{"type":38,"value":329},{"type":33,"tag":64,"props":1706,"children":1707},{"class":66,"line":481},[1708,1712],{"type":33,"tag":64,"props":1709,"children":1710},{"style":110},[1711],{"type":38,"value":770},{"type":33,"tag":64,"props":1713,"children":1714},{"style":87},[1715],{"type":38,"value":1716}," (\n",{"type":33,"tag":64,"props":1718,"children":1719},{"class":66,"line":499},[1720],{"type":33,"tag":64,"props":1721,"children":1722},{"style":87},[1723],{"type":38,"value":1724},"    \u003C>\n",{"type":33,"tag":64,"props":1726,"children":1727},{"class":66,"line":508},[1728,1733],{"type":33,"tag":64,"props":1729,"children":1730},{"style":87},[1731],{"type":38,"value":1732},"      \u003C",{"type":33,"tag":64,"props":1734,"children":1735},{"style":858},[1736],{"type":38,"value":1737},"script\n",{"type":33,"tag":64,"props":1739,"children":1740},{"class":66,"line":537},[1741,1746,1750],{"type":33,"tag":64,"props":1742,"children":1743},{"style":81},[1744],{"type":38,"value":1745},"        type",{"type":33,"tag":64,"props":1747,"children":1748},{"style":110},[1749],{"type":38,"value":606},{"type":33,"tag":64,"props":1751,"children":1752},{"style":93},[1753],{"type":38,"value":1754},"\"application\u002Fld+json\"\n",{"type":33,"tag":64,"props":1756,"children":1757},{"class":66,"line":546},[1758,1763,1767,1772,1777,1782,1787],{"type":33,"tag":64,"props":1759,"children":1760},{"style":81},[1761],{"type":38,"value":1762},"        dangerouslySetInnerHTML",{"type":33,"tag":64,"props":1764,"children":1765},{"style":110},[1766],{"type":38,"value":606},{"type":33,"tag":64,"props":1768,"children":1769},{"style":87},[1770],{"type":38,"value":1771},"{{ __html: ",{"type":33,"tag":64,"props":1773,"children":1774},{"style":210},[1775],{"type":38,"value":1776},"JSON",{"type":33,"tag":64,"props":1778,"children":1779},{"style":87},[1780],{"type":38,"value":1781},".",{"type":33,"tag":64,"props":1783,"children":1784},{"style":81},[1785],{"type":38,"value":1786},"stringify",{"type":33,"tag":64,"props":1788,"children":1789},{"style":87},[1790],{"type":38,"value":1791},"(structuredData) }}\n",{"type":33,"tag":64,"props":1793,"children":1794},{"class":66,"line":555},[1795],{"type":33,"tag":64,"props":1796,"children":1797},{"style":87},[1798],{"type":38,"value":1799},"      \u002F>\n",{"type":33,"tag":64,"props":1801,"children":1802},{"class":66,"line":563},[1803,1808,1813],{"type":33,"tag":64,"props":1804,"children":1805},{"style":87},[1806],{"type":38,"value":1807},"      {",{"type":33,"tag":64,"props":1809,"children":1810},{"style":71},[1811],{"type":38,"value":1812},"\u002F* Product render *\u002F",{"type":33,"tag":64,"props":1814,"children":1815},{"style":87},[1816],{"type":38,"value":552},{"type":33,"tag":64,"props":1818,"children":1819},{"class":66,"line":590},[1820],{"type":33,"tag":64,"props":1821,"children":1822},{"style":87},[1823],{"type":38,"value":1824},"    \u003C\u002F>\n",{"type":33,"tag":64,"props":1826,"children":1827},{"class":66,"line":614},[1828],{"type":33,"tag":64,"props":1829,"children":1830},{"style":87},[1831],{"type":38,"value":1832},"  )\n",{"type":33,"tag":64,"props":1834,"children":1835},{"class":66,"line":679},[1836],{"type":33,"tag":64,"props":1837,"children":1838},{"style":87},[1839],{"type":38,"value":552},{"type":33,"tag":34,"props":1841,"children":1842},{},[1843],{"type":38,"value":1844},"Use Google Search Console's \"URL Inspection\" tool to monitor new page indexing status. For the first 30 days post-migration, check weekly \"Coverage\" reports: if the new system shows 50+ \"Indexed, not submitted in sitemap\" errors, your sitemap generation is broken.",{"type":33,"tag":820,"props":1846,"children":1848},{"id":1847},"redirect-chain-minimization",[1849],{"type":38,"value":1850},"Redirect Chain Minimization",{"type":33,"tag":34,"props":1852,"children":1853},{},[1854,1856,1862,1864,1870,1872,1881],{"type":38,"value":1855},"Clean up redirect chains in the legacy system. For example, if Shopify has ",{"type":33,"tag":60,"props":1857,"children":1859},{"className":1858},[],[1860],{"type":38,"value":1861},"\u002Fproducts\u002Fold-name",{"type":38,"value":1863}," → ",{"type":33,"tag":60,"props":1865,"children":1867},{"className":1866},[],[1868],{"type":38,"value":1869},"\u002Fproducts\u002Fnew-name",{"type":38,"value":1871}," redirects, use the final URL directly in the headless system. Redirect chains longer than two hops drain Google's crawl budget and reduce PageRank transfer efficiency. In Roibase's ",{"type":33,"tag":1873,"props":1874,"children":1878},"a",{"href":1875,"rel":1876},"https:\u002F\u002Fwww.roibase.com.tr\u002Fen\u002Fheadless",[1877],"nofollow",[1879],{"type":38,"value":1880},"Headless",{"type":38,"value":1882}," projects, the redirect audit phase typically achieves 40% chain reduction.",{"type":33,"tag":41,"props":1884,"children":1886},{"id":1885},"add-to-cart-abandon-analysis-conversion-funnel-monitoring",[1887],{"type":38,"value":1888},"Add-to-Cart Abandon Analysis: Conversion Funnel Monitoring",{"type":33,"tag":34,"props":1890,"children":1891},{},[1892],{"type":38,"value":1893},"The most sensitive metric during headless migration is add-to-cart (ATC) success rate. If the legacy system showed 99.5% ATC success and the new one drops to 98%, that's 1,500 lost carts per day (100,000 visitors × 3% ATC intent × 1.5% decline).",{"type":33,"tag":34,"props":1895,"children":1896},{},[1897],{"type":38,"value":1898},"Log ATC events at both client and server levels. Client-side GTM tags miss network failures; server-side logging is definitive:",{"type":33,"tag":53,"props":1900,"children":1902},{"className":55,"code":1901,"language":57,"meta":16,"style":16},"\u002F\u002F app\u002Fapi\u002Fcart\u002Fadd\u002Froute.ts (Next.js App Router)\nimport { NextResponse } from 'next\u002Fserver'\nimport { logEvent } from '@\u002Flib\u002Fanalytics'\n\nexport async function POST(request: Request) {\n  const { productId, quantity } = await request.json()\n  const startTime = Date.now()\n  \n  try {\n    const cart = await addToCart(productId, quantity)\n    const duration = Date.now() - startTime\n    \n    \u002F\u002F Server-side event logging\n    await logEvent({\n      event: 'add_to_cart_success',\n      productId,\n      quantity,\n      duration, \u002F\u002F ms\n      userId: request.headers.get('X-User-ID')\n    })\n    \n    return NextResponse.json({ cart }, { status: 200 })\n  } catch (error) {\n    const duration = Date.now() - startTime\n    \n    await logEvent({\n      event: 'add_to_cart_failure',\n      productId,\n      quantity,\n      duration,\n      error: error.message,\n      userId: request.headers.get('X-User-ID')\n    })\n    \n    return NextResponse.json({ error: 'Failed to add to cart' }, { status: 500 })\n  }\n}\n",[1903],{"type":33,"tag":60,"props":1904,"children":1905},{"__ignoreMap":16},[1906,1914,1937,1958,1965,2008,2062,2092,2099,2111,2142,2180,2188,2196,2214,2231,2239,2247,2260,2284,2292,2299,2330,2347,2382,2389,2404,2420,2427,2434,2443,2452,2476,2484,2492,2532,2540],{"type":33,"tag":64,"props":1907,"children":1908},{"class":66,"line":67},[1909],{"type":33,"tag":64,"props":1910,"children":1911},{"style":71},[1912],{"type":38,"value":1913},"\u002F\u002F app\u002Fapi\u002Fcart\u002Fadd\u002Froute.ts (Next.js App Router)\n",{"type":33,"tag":64,"props":1915,"children":1916},{"class":66,"line":77},[1917,1922,1927,1932],{"type":33,"tag":64,"props":1918,"children":1919},{"style":110},[1920],{"type":38,"value":1921},"import",{"type":33,"tag":64,"props":1923,"children":1924},{"style":87},[1925],{"type":38,"value":1926}," { NextResponse } ",{"type":33,"tag":64,"props":1928,"children":1929},{"style":110},[1930],{"type":38,"value":1931},"from",{"type":33,"tag":64,"props":1933,"children":1934},{"style":93},[1935],{"type":38,"value":1936}," 'next\u002Fserver'\n",{"type":33,"tag":64,"props":1938,"children":1939},{"class":66,"line":121},[1940,1944,1949,1953],{"type":33,"tag":64,"props":1941,"children":1942},{"style":110},[1943],{"type":38,"value":1921},{"type":33,"tag":64,"props":1945,"children":1946},{"style":87},[1947],{"type":38,"value":1948}," { logEvent } ",{"type":33,"tag":64,"props":1950,"children":1951},{"style":110},[1952],{"type":38,"value":1931},{"type":33,"tag":64,"props":1954,"children":1955},{"style":93},[1956],{"type":38,"value":1957}," '@\u002Flib\u002Fanalytics'\n",{"type":33,"tag":64,"props":1959,"children":1960},{"class":66,"line":149},[1961],{"type":33,"tag":64,"props":1962,"children":1963},{"emptyLinePlaceholder":162},[1964],{"type":38,"value":165},{"type":33,"tag":64,"props":1966,"children":1967},{"class":66,"line":158},[1968,1972,1977,1981,1986,1990,1994,1999,2004],{"type":33,"tag":64,"props":1969,"children":1970},{"style":110},[1971],{"type":38,"value":1455},{"type":33,"tag":64,"props":1973,"children":1974},{"style":110},[1975],{"type":38,"value":1976}," async",{"type":33,"tag":64,"props":1978,"children":1979},{"style":110},[1980],{"type":38,"value":179},{"type":33,"tag":64,"props":1982,"children":1983},{"style":81},[1984],{"type":38,"value":1985}," POST",{"type":33,"tag":64,"props":1987,"children":1988},{"style":87},[1989],{"type":38,"value":90},{"type":33,"tag":64,"props":1991,"children":1992},{"style":104},[1993],{"type":38,"value":193},{"type":33,"tag":64,"props":1995,"children":1996},{"style":110},[1997],{"type":38,"value":1998},":",{"type":33,"tag":64,"props":2000,"children":2001},{"style":81},[2002],{"type":38,"value":2003}," Request",{"type":33,"tag":64,"props":2005,"children":2006},{"style":87},[2007],{"type":38,"value":198},{"type":33,"tag":64,"props":2009,"children":2010},{"class":66,"line":168},[2011,2015,2020,2025,2029,2034,2039,2043,2048,2053,2058],{"type":33,"tag":64,"props":2012,"children":2013},{"style":110},[2014],{"type":38,"value":207},{"type":33,"tag":64,"props":2016,"children":2017},{"style":87},[2018],{"type":38,"value":2019}," { ",{"type":33,"tag":64,"props":2021,"children":2022},{"style":210},[2023],{"type":38,"value":2024},"productId",{"type":33,"tag":64,"props":2026,"children":2027},{"style":87},[2028],{"type":38,"value":101},{"type":33,"tag":64,"props":2030,"children":2031},{"style":210},[2032],{"type":38,"value":2033},"quantity",{"type":33,"tag":64,"props":2035,"children":2036},{"style":87},[2037],{"type":38,"value":2038}," } ",{"type":33,"tag":64,"props":2040,"children":2041},{"style":110},[2042],{"type":38,"value":606},{"type":33,"tag":64,"props":2044,"children":2045},{"style":110},[2046],{"type":38,"value":2047}," await",{"type":33,"tag":64,"props":2049,"children":2050},{"style":87},[2051],{"type":38,"value":2052}," request.",{"type":33,"tag":64,"props":2054,"children":2055},{"style":81},[2056],{"type":38,"value":2057},"json",{"type":33,"tag":64,"props":2059,"children":2060},{"style":87},[2061],{"type":38,"value":293},{"type":33,"tag":64,"props":2063,"children":2064},{"class":66,"line":201},[2065,2069,2074,2078,2083,2088],{"type":33,"tag":64,"props":2066,"children":2067},{"style":110},[2068],{"type":38,"value":207},{"type":33,"tag":64,"props":2070,"children":2071},{"style":210},[2072],{"type":38,"value":2073}," startTime",{"type":33,"tag":64,"props":2075,"children":2076},{"style":110},[2077],{"type":38,"value":218},{"type":33,"tag":64,"props":2079,"children":2080},{"style":87},[2081],{"type":38,"value":2082}," Date.",{"type":33,"tag":64,"props":2084,"children":2085},{"style":81},[2086],{"type":38,"value":2087},"now",{"type":33,"tag":64,"props":2089,"children":2090},{"style":87},[2091],{"type":38,"value":293},{"type":33,"tag":64,"props":2093,"children":2094},{"class":66,"line":27},[2095],{"type":33,"tag":64,"props":2096,"children":2097},{"style":87},[2098],{"type":38,"value":329},{"type":33,"tag":64,"props":2100,"children":2101},{"class":66,"line":296},[2102,2107],{"type":33,"tag":64,"props":2103,"children":2104},{"style":110},[2105],{"type":38,"value":2106},"  try",{"type":33,"tag":64,"props":2108,"children":2109},{"style":87},[2110],{"type":38,"value":118},{"type":33,"tag":64,"props":2112,"children":2113},{"class":66,"line":323},[2114,2119,2124,2128,2132,2137],{"type":33,"tag":64,"props":2115,"children":2116},{"style":110},[2117],{"type":38,"value":2118},"    const",{"type":33,"tag":64,"props":2120,"children":2121},{"style":210},[2122],{"type":38,"value":2123}," cart",{"type":33,"tag":64,"props":2125,"children":2126},{"style":110},[2127],{"type":38,"value":218},{"type":33,"tag":64,"props":2129,"children":2130},{"style":110},[2131],{"type":38,"value":2047},{"type":33,"tag":64,"props":2133,"children":2134},{"style":81},[2135],{"type":38,"value":2136}," addToCart",{"type":33,"tag":64,"props":2138,"children":2139},{"style":87},[2140],{"type":38,"value":2141},"(productId, quantity)\n",{"type":33,"tag":64,"props":2143,"children":2144},{"class":66,"line":332},[2145,2149,2154,2158,2162,2166,2171,2175],{"type":33,"tag":64,"props":2146,"children":2147},{"style":110},[2148],{"type":38,"value":2118},{"type":33,"tag":64,"props":2150,"children":2151},{"style":210},[2152],{"type":38,"value":2153}," duration",{"type":33,"tag":64,"props":2155,"children":2156},{"style":110},[2157],{"type":38,"value":218},{"type":33,"tag":64,"props":2159,"children":2160},{"style":87},[2161],{"type":38,"value":2082},{"type":33,"tag":64,"props":2163,"children":2164},{"style":81},[2165],{"type":38,"value":2087},{"type":33,"tag":64,"props":2167,"children":2168},{"style":87},[2169],{"type":38,"value":2170},"() ",{"type":33,"tag":64,"props":2172,"children":2173},{"style":110},[2174],{"type":38,"value":712},{"type":33,"tag":64,"props":2176,"children":2177},{"style":87},[2178],{"type":38,"value":2179}," startTime\n",{"type":33,"tag":64,"props":2181,"children":2182},{"class":66,"line":388},[2183],{"type":33,"tag":64,"props":2184,"children":2185},{"style":87},[2186],{"type":38,"value":2187},"    \n",{"type":33,"tag":64,"props":2189,"children":2190},{"class":66,"line":396},[2191],{"type":33,"tag":64,"props":2192,"children":2193},{"style":71},[2194],{"type":38,"value":2195},"    \u002F\u002F Server-side event logging\n",{"type":33,"tag":64,"props":2197,"children":2198},{"class":66,"line":439},[2199,2204,2209],{"type":33,"tag":64,"props":2200,"children":2201},{"style":110},[2202],{"type":38,"value":2203},"    await",{"type":33,"tag":64,"props":2205,"children":2206},{"style":81},[2207],{"type":38,"value":2208}," logEvent",{"type":33,"tag":64,"props":2210,"children":2211},{"style":87},[2212],{"type":38,"value":2213},"({\n",{"type":33,"tag":64,"props":2215,"children":2216},{"class":66,"line":448},[2217,2222,2227],{"type":33,"tag":64,"props":2218,"children":2219},{"style":87},[2220],{"type":38,"value":2221},"      event: ",{"type":33,"tag":64,"props":2223,"children":2224},{"style":93},[2225],{"type":38,"value":2226},"'add_to_cart_success'",{"type":33,"tag":64,"props":2228,"children":2229},{"style":87},[2230],{"type":38,"value":1189},{"type":33,"tag":64,"props":2232,"children":2233},{"class":66,"line":481},[2234],{"type":33,"tag":64,"props":2235,"children":2236},{"style":87},[2237],{"type":38,"value":2238},"      productId,\n",{"type":33,"tag":64,"props":2240,"children":2241},{"class":66,"line":499},[2242],{"type":33,"tag":64,"props":2243,"children":2244},{"style":87},[2245],{"type":38,"value":2246},"      quantity,\n",{"type":33,"tag":64,"props":2248,"children":2249},{"class":66,"line":508},[2250,2255],{"type":33,"tag":64,"props":2251,"children":2252},{"style":87},[2253],{"type":38,"value":2254},"      duration, ",{"type":33,"tag":64,"props":2256,"children":2257},{"style":71},[2258],{"type":38,"value":2259},"\u002F\u002F ms\n",{"type":33,"tag":64,"props":2261,"children":2262},{"class":66,"line":537},[2263,2268,2272,2276,2280],{"type":33,"tag":64,"props":2264,"children":2265},{"style":87},[2266],{"type":38,"value":2267},"      userId: request.headers.",{"type":33,"tag":64,"props":2269,"children":2270},{"style":81},[2271],{"type":38,"value":259},{"type":33,"tag":64,"props":2273,"children":2274},{"style":87},[2275],{"type":38,"value":90},{"type":33,"tag":64,"props":2277,"children":2278},{"style":93},[2279],{"type":38,"value":268},{"type":33,"tag":64,"props":2281,"children":2282},{"style":87},[2283],{"type":38,"value":1364},{"type":33,"tag":64,"props":2285,"children":2286},{"class":66,"line":546},[2287],{"type":33,"tag":64,"props":2288,"children":2289},{"style":87},[2290],{"type":38,"value":2291},"    })\n",{"type":33,"tag":64,"props":2293,"children":2294},{"class":66,"line":555},[2295],{"type":33,"tag":64,"props":2296,"children":2297},{"style":87},[2298],{"type":38,"value":2187},{"type":33,"tag":64,"props":2300,"children":2301},{"class":66,"line":563},[2302,2306,2311,2315,2320,2325],{"type":33,"tag":64,"props":2303,"children":2304},{"style":110},[2305],{"type":38,"value":454},{"type":33,"tag":64,"props":2307,"children":2308},{"style":87},[2309],{"type":38,"value":2310}," NextResponse.",{"type":33,"tag":64,"props":2312,"children":2313},{"style":81},[2314],{"type":38,"value":2057},{"type":33,"tag":64,"props":2316,"children":2317},{"style":87},[2318],{"type":38,"value":2319},"({ cart }, { status: ",{"type":33,"tag":64,"props":2321,"children":2322},{"style":210},[2323],{"type":38,"value":2324},"200",{"type":33,"tag":64,"props":2326,"children":2327},{"style":87},[2328],{"type":38,"value":2329}," })\n",{"type":33,"tag":64,"props":2331,"children":2332},{"class":66,"line":590},[2333,2337,2342],{"type":33,"tag":64,"props":2334,"children":2335},{"style":87},[2336],{"type":38,"value":487},{"type":33,"tag":64,"props":2338,"children":2339},{"style":110},[2340],{"type":38,"value":2341},"catch",{"type":33,"tag":64,"props":2343,"children":2344},{"style":87},[2345],{"type":38,"value":2346}," (error) {\n",{"type":33,"tag":64,"props":2348,"children":2349},{"class":66,"line":614},[2350,2354,2358,2362,2366,2370,2374,2378],{"type":33,"tag":64,"props":2351,"children":2352},{"style":110},[2353],{"type":38,"value":2118},{"type":33,"tag":64,"props":2355,"children":2356},{"style":210},[2357],{"type":38,"value":2153},{"type":33,"tag":64,"props":2359,"children":2360},{"style":110},[2361],{"type":38,"value":218},{"type":33,"tag":64,"props":2363,"children":2364},{"style":87},[2365],{"type":38,"value":2082},{"type":33,"tag":64,"props":2367,"children":2368},{"style":81},[2369],{"type":38,"value":2087},{"type":33,"tag":64,"props":2371,"children":2372},{"style":87},[2373],{"type":38,"value":2170},{"type":33,"tag":64,"props":2375,"children":2376},{"style":110},[2377],{"type":38,"value":712},{"type":33,"tag":64,"props":2379,"children":2380},{"style":87},[2381],{"type":38,"value":2179},{"type":33,"tag":64,"props":2383,"children":2384},{"class":66,"line":679},[2385],{"type":33,"tag":64,"props":2386,"children":2387},{"style":87},[2388],{"type":38,"value":2187},{"type":33,"tag":64,"props":2390,"children":2391},{"class":66,"line":739},[2392,2396,2400],{"type":33,"tag":64,"props":2393,"children":2394},{"style":110},[2395],{"type":38,"value":2203},{"type":33,"tag":64,"props":2397,"children":2398},{"style":81},[2399],{"type":38,"value":2208},{"type":33,"tag":64,"props":2401,"children":2402},{"style":87},[2403],{"type":38,"value":2213},{"type":33,"tag":64,"props":2405,"children":2406},{"class":66,"line":756},[2407,2411,2416],{"type":33,"tag":64,"props":2408,"children":2409},{"style":87},[2410],{"type":38,"value":2221},{"type":33,"tag":64,"props":2412,"children":2413},{"style":93},[2414],{"type":38,"value":2415},"'add_to_cart_failure'",{"type":33,"tag":64,"props":2417,"children":2418},{"style":87},[2419],{"type":38,"value":1189},{"type":33,"tag":64,"props":2421,"children":2422},{"class":66,"line":764},[2423],{"type":33,"tag":64,"props":2424,"children":2425},{"style":87},[2426],{"type":38,"value":2238},{"type":33,"tag":64,"props":2428,"children":2429},{"class":66,"line":787},[2430],{"type":33,"tag":64,"props":2431,"children":2432},{"style":87},[2433],{"type":38,"value":2246},{"type":33,"tag":64,"props":2435,"children":2437},{"class":66,"line":2436},30,[2438],{"type":33,"tag":64,"props":2439,"children":2440},{"style":87},[2441],{"type":38,"value":2442},"      duration,\n",{"type":33,"tag":64,"props":2444,"children":2446},{"class":66,"line":2445},31,[2447],{"type":33,"tag":64,"props":2448,"children":2449},{"style":87},[2450],{"type":38,"value":2451},"      error: error.message,\n",{"type":33,"tag":64,"props":2453,"children":2455},{"class":66,"line":2454},32,[2456,2460,2464,2468,2472],{"type":33,"tag":64,"props":2457,"children":2458},{"style":87},[2459],{"type":38,"value":2267},{"type":33,"tag":64,"props":2461,"children":2462},{"style":81},[2463],{"type":38,"value":259},{"type":33,"tag":64,"props":2465,"children":2466},{"style":87},[2467],{"type":38,"value":90},{"type":33,"tag":64,"props":2469,"children":2470},{"style":93},[2471],{"type":38,"value":268},{"type":33,"tag":64,"props":2473,"children":2474},{"style":87},[2475],{"type":38,"value":1364},{"type":33,"tag":64,"props":2477,"children":2479},{"class":66,"line":2478},33,[2480],{"type":33,"tag":64,"props":2481,"children":2482},{"style":87},[2483],{"type":38,"value":2291},{"type":33,"tag":64,"props":2485,"children":2487},{"class":66,"line":2486},34,[2488],{"type":33,"tag":64,"props":2489,"children":2490},{"style":87},[2491],{"type":38,"value":2187},{"type":33,"tag":64,"props":2493,"children":2495},{"class":66,"line":2494},35,[2496,2500,2504,2508,2513,2518,2523,2528],{"type":33,"tag":64,"props":2497,"children":2498},{"style":110},[2499],{"type":38,"value":454},{"type":33,"tag":64,"props":2501,"children":2502},{"style":87},[2503],{"type":38,"value":2310},{"type":33,"tag":64,"props":2505,"children":2506},{"style":81},[2507],{"type":38,"value":2057},{"type":33,"tag":64,"props":2509,"children":2510},{"style":87},[2511],{"type":38,"value":2512},"({ error: ",{"type":33,"tag":64,"props":2514,"children":2515},{"style":93},[2516],{"type":38,"value":2517},"'Failed to add to cart'",{"type":33,"tag":64,"props":2519,"children":2520},{"style":87},[2521],{"type":38,"value":2522}," }, { status: ",{"type":33,"tag":64,"props":2524,"children":2525},{"style":210},[2526],{"type":38,"value":2527},"500",{"type":33,"tag":64,"props":2529,"children":2530},{"style":87},[2531],{"type":38,"value":2329},{"type":33,"tag":64,"props":2533,"children":2535},{"class":66,"line":2534},36,[2536],{"type":33,"tag":64,"props":2537,"children":2538},{"style":87},[2539],{"type":38,"value":543},{"type":33,"tag":64,"props":2541,"children":2543},{"class":66,"line":2542},37,[2544],{"type":33,"tag":64,"props":2545,"children":2546},{"style":87},[2547],{"type":38,"value":552},{"type":33,"tag":34,"props":2549,"children":2550},{},[2551],{"type":38,"value":2552},"Aggregate these logs in BigQuery and run anomaly detection:",{"type":33,"tag":53,"props":2554,"children":2558},{"className":2555,"code":2556,"language":2557,"meta":16,"style":16},"language-sql shiki shiki-themes github-dark","-- Daily ATC success rate comparison\nSELECT\n  DATE(timestamp) AS date,\n  COUNTIF(event = 'add_to_cart_success') AS success_count,\n  COUNTIF(event = 'add_to_cart_failure') AS failure_count,\n  SAFE_DIVIDE(\n    COUNTIF(event = 'add_to_cart_success'),\n    COUNTIF(event IN ('add_to_cart_success', 'add_to_cart_failure'))\n  ) * 100 AS success_rate_percent\nFROM analytics.events\nWHERE DATE(timestamp) >= DATE_SUB(CURRENT_DATE(), INTERVAL 7 DAY)\nGROUP BY date\nORDER BY date DESC\n","sql",[2559],{"type":33,"tag":60,"props":2560,"children":2561},{"__ignoreMap":16},[2562,2570,2578,2613,2647,2680,2688,2713,2750,2777,2799,2848,2861],{"type":33,"tag":64,"props":2563,"children":2564},{"class":66,"line":67},[2565],{"type":33,"tag":64,"props":2566,"children":2567},{"style":71},[2568],{"type":38,"value":2569},"-- Daily ATC success rate comparison\n",{"type":33,"tag":64,"props":2571,"children":2572},{"class":66,"line":77},[2573],{"type":33,"tag":64,"props":2574,"children":2575},{"style":110},[2576],{"type":38,"value":2577},"SELECT\n",{"type":33,"tag":64,"props":2579,"children":2580},{"class":66,"line":121},[2581,2586,2590,2595,2599,2604,2609],{"type":33,"tag":64,"props":2582,"children":2583},{"style":110},[2584],{"type":38,"value":2585},"  DATE",{"type":33,"tag":64,"props":2587,"children":2588},{"style":87},[2589],{"type":38,"value":90},{"type":33,"tag":64,"props":2591,"children":2592},{"style":110},[2593],{"type":38,"value":2594},"timestamp",{"type":33,"tag":64,"props":2596,"children":2597},{"style":87},[2598],{"type":38,"value":273},{"type":33,"tag":64,"props":2600,"children":2601},{"style":110},[2602],{"type":38,"value":2603},"AS",{"type":33,"tag":64,"props":2605,"children":2606},{"style":110},[2607],{"type":38,"value":2608}," date",{"type":33,"tag":64,"props":2610,"children":2611},{"style":87},[2612],{"type":38,"value":1189},{"type":33,"tag":64,"props":2614,"children":2615},{"class":66,"line":149},[2616,2621,2625,2629,2634,2638,2642],{"type":33,"tag":64,"props":2617,"children":2618},{"style":87},[2619],{"type":38,"value":2620},"  COUNTIF(",{"type":33,"tag":64,"props":2622,"children":2623},{"style":110},[2624],{"type":38,"value":107},{"type":33,"tag":64,"props":2626,"children":2627},{"style":110},[2628],{"type":38,"value":218},{"type":33,"tag":64,"props":2630,"children":2631},{"style":93},[2632],{"type":38,"value":2633}," 'add_to_cart_success'",{"type":33,"tag":64,"props":2635,"children":2636},{"style":87},[2637],{"type":38,"value":273},{"type":33,"tag":64,"props":2639,"children":2640},{"style":110},[2641],{"type":38,"value":2603},{"type":33,"tag":64,"props":2643,"children":2644},{"style":87},[2645],{"type":38,"value":2646}," success_count,\n",{"type":33,"tag":64,"props":2648,"children":2649},{"class":66,"line":158},[2650,2654,2658,2662,2667,2671,2675],{"type":33,"tag":64,"props":2651,"children":2652},{"style":87},[2653],{"type":38,"value":2620},{"type":33,"tag":64,"props":2655,"children":2656},{"style":110},[2657],{"type":38,"value":107},{"type":33,"tag":64,"props":2659,"children":2660},{"style":110},[2661],{"type":38,"value":218},{"type":33,"tag":64,"props":2663,"children":2664},{"style":93},[2665],{"type":38,"value":2666}," 'add_to_cart_failure'",{"type":33,"tag":64,"props":2668,"children":2669},{"style":87},[2670],{"type":38,"value":273},{"type":33,"tag":64,"props":2672,"children":2673},{"style":110},[2674],{"type":38,"value":2603},{"type":33,"tag":64,"props":2676,"children":2677},{"style":87},[2678],{"type":38,"value":2679}," failure_count,\n",{"type":33,"tag":64,"props":2681,"children":2682},{"class":66,"line":168},[2683],{"type":33,"tag":64,"props":2684,"children":2685},{"style":87},[2686],{"type":38,"value":2687},"  SAFE_DIVIDE(\n",{"type":33,"tag":64,"props":2689,"children":2690},{"class":66,"line":201},[2691,2696,2700,2704,2708],{"type":33,"tag":64,"props":2692,"children":2693},{"style":87},[2694],{"type":38,"value":2695},"    COUNTIF(",{"type":33,"tag":64,"props":2697,"children":2698},{"style":110},[2699],{"type":38,"value":107},{"type":33,"tag":64,"props":2701,"children":2702},{"style":110},[2703],{"type":38,"value":218},{"type":33,"tag":64,"props":2705,"children":2706},{"style":93},[2707],{"type":38,"value":2633},{"type":33,"tag":64,"props":2709,"children":2710},{"style":87},[2711],{"type":38,"value":2712},"),\n",{"type":33,"tag":64,"props":2714,"children":2715},{"class":66,"line":27},[2716,2720,2724,2729,2733,2737,2741,2745],{"type":33,"tag":64,"props":2717,"children":2718},{"style":87},[2719],{"type":38,"value":2695},{"type":33,"tag":64,"props":2721,"children":2722},{"style":110},[2723],{"type":38,"value":107},{"type":33,"tag":64,"props":2725,"children":2726},{"style":110},[2727],{"type":38,"value":2728}," IN",{"type":33,"tag":64,"props":2730,"children":2731},{"style":87},[2732],{"type":38,"value":351},{"type":33,"tag":64,"props":2734,"children":2735},{"style":93},[2736],{"type":38,"value":2226},{"type":33,"tag":64,"props":2738,"children":2739},{"style":87},[2740],{"type":38,"value":101},{"type":33,"tag":64,"props":2742,"children":2743},{"style":93},[2744],{"type":38,"value":2415},{"type":33,"tag":64,"props":2746,"children":2747},{"style":87},[2748],{"type":38,"value":2749},"))\n",{"type":33,"tag":64,"props":2751,"children":2752},{"class":66,"line":296},[2753,2758,2763,2767,2772],{"type":33,"tag":64,"props":2754,"children":2755},{"style":87},[2756],{"type":38,"value":2757},"  ) ",{"type":33,"tag":64,"props":2759,"children":2760},{"style":110},[2761],{"type":38,"value":2762},"*",{"type":33,"tag":64,"props":2764,"children":2765},{"style":210},[2766],{"type":38,"value":371},{"type":33,"tag":64,"props":2768,"children":2769},{"style":110},[2770],{"type":38,"value":2771}," AS",{"type":33,"tag":64,"props":2773,"children":2774},{"style":87},[2775],{"type":38,"value":2776}," success_rate_percent\n",{"type":33,"tag":64,"props":2778,"children":2779},{"class":66,"line":323},[2780,2785,2790,2794],{"type":33,"tag":64,"props":2781,"children":2782},{"style":110},[2783],{"type":38,"value":2784},"FROM",{"type":33,"tag":64,"props":2786,"children":2787},{"style":210},[2788],{"type":38,"value":2789}," analytics",{"type":33,"tag":64,"props":2791,"children":2792},{"style":87},[2793],{"type":38,"value":1781},{"type":33,"tag":64,"props":2795,"children":2796},{"style":210},[2797],{"type":38,"value":2798},"events\n",{"type":33,"tag":64,"props":2800,"children":2801},{"class":66,"line":332},[2802,2807,2812,2816,2820,2824,2829,2834,2839,2844],{"type":33,"tag":64,"props":2803,"children":2804},{"style":110},[2805],{"type":38,"value":2806},"WHERE",{"type":33,"tag":64,"props":2808,"children":2809},{"style":110},[2810],{"type":38,"value":2811}," DATE",{"type":33,"tag":64,"props":2813,"children":2814},{"style":87},[2815],{"type":38,"value":90},{"type":33,"tag":64,"props":2817,"children":2818},{"style":110},[2819],{"type":38,"value":2594},{"type":33,"tag":64,"props":2821,"children":2822},{"style":87},[2823],{"type":38,"value":273},{"type":33,"tag":64,"props":2825,"children":2826},{"style":110},[2827],{"type":38,"value":2828},">=",{"type":33,"tag":64,"props":2830,"children":2831},{"style":87},[2832],{"type":38,"value":2833}," DATE_SUB(CURRENT_DATE(), INTERVAL ",{"type":33,"tag":64,"props":2835,"children":2836},{"style":210},[2837],{"type":38,"value":2838},"7",{"type":33,"tag":64,"props":2840,"children":2841},{"style":110},[2842],{"type":38,"value":2843}," DAY",{"type":33,"tag":64,"props":2845,"children":2846},{"style":87},[2847],{"type":38,"value":1364},{"type":33,"tag":64,"props":2849,"children":2850},{"class":66,"line":388},[2851,2856],{"type":33,"tag":64,"props":2852,"children":2853},{"style":110},[2854],{"type":38,"value":2855},"GROUP BY",{"type":33,"tag":64,"props":2857,"children":2858},{"style":110},[2859],{"type":38,"value":2860}," date\n",{"type":33,"tag":64,"props":2862,"children":2863},{"class":66,"line":396},[2864,2869,2873],{"type":33,"tag":64,"props":2865,"children":2866},{"style":110},[2867],{"type":38,"value":2868},"ORDER BY",{"type":33,"tag":64,"props":2870,"children":2871},{"style":110},[2872],{"type":38,"value":2608},{"type":33,"tag":64,"props":2874,"children":2875},{"style":110},[2876],{"type":38,"value":2877}," DESC\n",{"type":33,"tag":34,"props":2879,"children":2880},{},[2881,2883,2889],{"type":38,"value":2882},"Set alarms if success rate drops below 99% (Slack webhook, PagerDuty). Also monitor the ",{"type":33,"tag":60,"props":2884,"children":2886},{"className":2885},[],[2887],{"type":38,"value":2888},"duration",{"type":38,"value":2890}," metric: if legacy ATC response time averaged 120ms, headless should hit 80ms—if it climbs to 200ms, you need database query optimization.",{"type":33,"tag":820,"props":2892,"children":2894},{"id":2893},"session-replay-and-error-tracking",[2895],{"type":38,"value":2896},"Session Replay and Error Tracking",{"type":33,"tag":34,"props":2898,"children":2899},{},[2900],{"type":38,"value":2901},"Implement session replay with tools like Sentry or LogRocket. Correlate ATC failure events with session IDs to see the complete user journey: at which step did the button stay disabled, which network request timed out? In Roibase's headless migration projects, session replay reveals that 60% of detected bugs stem from race conditions—for instance, the inventory check API completing after the cart mutation, causing premature button enable.",{"type":33,"tag":41,"props":2903,"children":2905},{"id":2904},"performance-metrics-core-web-vitals-and-runtime-cost",[2906],{"type":38,"value":2907},"Performance Metrics: Core Web Vitals and Runtime Cost",{"type":33,"tag":34,"props":2909,"children":2910},{},[2911],{"type":38,"value":2912},"The entire purpose of headless migration is performance improvement. Yet poorly implemented headless systems can be SLOWER than monolithic Shopify. If you're doing client-side rendering (CSR), LCP climbs above 4 seconds; the correct approach is server-side rendering (SSR) or static site generation (SSG) plus incremental static regeneration (ISR).",{"type":33,"tag":34,"props":2914,"children":2915},{},[2916],{"type":38,"value":2917},"Next.js App Router example for product detail pages with ISR:",{"type":33,"tag":53,"props":2919,"children":2923},{"className":2920,"code":2921,"language":2922,"meta":16,"style":16},"language-tsx shiki shiki-themes github-dark","\u002F\u002F app\u002Fproducts\u002F[slug]\u002Fpage.tsx\nexport const revalidate = 3600 \u002F\u002F Regenerate every hour\n\nexport async function generateStaticParams() {\n  const products = await getTopProducts(100) \u002F\u002F Pre-render top 100 products\n  return products.map(p => ({ slug: p.slug }))\n}\n\nexport default async function ProductPage({ params }) {\n  const product = await getProduct(params.slug)\n  \n  return (\n    \u003Cdiv>\n      \u003Ch1>{product.title}\u003C\u002Fh1>\n      \u003CImage src={product.image} alt={product.title} priority \u002F>\n      \u003CAddToCartButton productId={product.id} \u002F>\n    \u003C\u002Fdiv>\n  )\n}\n","tsx",[2924],{"type":33,"tag":60,"props":2925,"children":2926},{"__ignoreMap":16},[2927,2934,2965,2972,2997,3040,3074,3081,3088,3124,3154,3161,3172,3190,3215,3265,3291,3307,3314],{"type":33,"tag":64,"props":2928,"children":2929},{"class":66,"line":67},[2930],{"type":33,"tag":64,"props":2931,"children":2932},{"style":71},[2933],{"type":38,"value":1447},{"type":33,"tag":64,"props":2935,"children":2936},{"class":66,"line":77},[2937,2941,2946,2951,2955,2960],{"type":33,"tag":64,"props":2938,"children":2939},{"style":110},[2940],{"type":38,"value":1455},{"type":33,"tag":64,"props":2942,"children":2943},{"style":110},[2944],{"type":38,"value":2945}," const",{"type":33,"tag":64,"props":2947,"children":2948},{"style":210},[2949],{"type":38,"value":2950}," revalidate",{"type":33,"tag":64,"props":2952,"children":2953},{"style":110},[2954],{"type":38,"value":218},{"type":33,"tag":64,"props":2956,"children":2957},{"style":210},[2958],{"type":38,"value":2959}," 3600",{"type":33,"tag":64,"props":2961,"children":2962},{"style":71},[2963],{"type":38,"value":2964}," \u002F\u002F Regenerate every hour\n",{"type":33,"tag":64,"props":2966,"children":2967},{"class":66,"line":121},[2968],{"type":33,"tag":64,"props":2969,"children":2970},{"emptyLinePlaceholder":162},[2971],{"type":38,"value":165},{"type":33,"tag":64,"props":2973,"children":2974},{"class":66,"line":149},[2975,2979,2983,2987,2992],{"type":33,"tag":64,"props":2976,"children":2977},{"style":110},[2978],{"type":38,"value":1455},{"type":33,"tag":64,"props":2980,"children":2981},{"style":110},[2982],{"type":38,"value":1976},{"type":33,"tag":64,"props":2984,"children":2985},{"style":110},[2986],{"type":38,"value":179},{"type":33,"tag":64,"props":2988,"children":2989},{"style":81},[2990],{"type":38,"value":2991}," generateStaticParams",{"type":33,"tag":64,"props":2993,"children":2994},{"style":87},[2995],{"type":38,"value":2996},"() {\n",{"type":33,"tag":64,"props":2998,"children":2999},{"class":66,"line":158},[3000,3004,3009,3013,3017,3022,3026,3031,3035],{"type":33,"tag":64,"props":3001,"children":3002},{"style":110},[3003],{"type":38,"value":207},{"type":33,"tag":64,"props":3005,"children":3006},{"style":210},[3007],{"type":38,"value":3008}," products",{"type":33,"tag":64,"props":3010,"children":3011},{"style":110},[3012],{"type":38,"value":218},{"type":33,"tag":64,"props":3014,"children":3015},{"style":110},[3016],{"type":38,"value":2047},{"type":33,"tag":64,"props":3018,"children":3019},{"style":81},[3020],{"type":38,"value":3021}," getTopProducts",{"type":33,"tag":64,"props":3023,"children":3024},{"style":87},[3025],{"type":38,"value":90},{"type":33,"tag":64,"props":3027,"children":3028},{"style":210},[3029],{"type":38,"value":3030},"100",{"type":33,"tag":64,"props":3032,"children":3033},{"style":87},[3034],{"type":38,"value":273},{"type":33,"tag":64,"props":3036,"children":3037},{"style":71},[3038],{"type":38,"value":3039},"\u002F\u002F Pre-render top 100 products\n",{"type":33,"tag":64,"props":3041,"children":3042},{"class":66,"line":168},[3043,3047,3052,3057,3061,3065,3069],{"type":33,"tag":64,"props":3044,"children":3045},{"style":110},[3046],{"type":38,"value":770},{"type":33,"tag":64,"props":3048,"children":3049},{"style":87},[3050],{"type":38,"value":3051}," products.",{"type":33,"tag":64,"props":3053,"children":3054},{"style":81},[3055],{"type":38,"value":3056},"map",{"type":33,"tag":64,"props":3058,"children":3059},{"style":87},[3060],{"type":38,"value":90},{"type":33,"tag":64,"props":3062,"children":3063},{"style":104},[3064],{"type":38,"value":34},{"type":33,"tag":64,"props":3066,"children":3067},{"style":110},[3068],{"type":38,"value":113},{"type":33,"tag":64,"props":3070,"children":3071},{"style":87},[3072],{"type":38,"value":3073}," ({ slug: p.slug }))\n",{"type":33,"tag":64,"props":3075,"children":3076},{"class":66,"line":201},[3077],{"type":33,"tag":64,"props":3078,"children":3079},{"style":87},[3080],{"type":38,"value":552},{"type":33,"tag":64,"props":3082,"children":3083},{"class":66,"line":27},[3084],{"type":33,"tag":64,"props":3085,"children":3086},{"emptyLinePlaceholder":162},[3087],{"type":38,"value":165},{"type":33,"tag":64,"props":3089,"children":3090},{"class":66,"line":296},[3091,3095,3099,3103,3107,3111,3115,3120],{"type":33,"tag":64,"props":3092,"children":3093},{"style":110},[3094],{"type":38,"value":1455},{"type":33,"tag":64,"props":3096,"children":3097},{"style":110},[3098],{"type":38,"value":1460},{"type":33,"tag":64,"props":3100,"children":3101},{"style":110},[3102],{"type":38,"value":1976},{"type":33,"tag":64,"props":3104,"children":3105},{"style":110},[3106],{"type":38,"value":179},{"type":33,"tag":64,"props":3108,"children":3109},{"style":81},[3110],{"type":38,"value":1469},{"type":33,"tag":64,"props":3112,"children":3113},{"style":87},[3114],{"type":38,"value":1474},{"type":33,"tag":64,"props":3116,"children":3117},{"style":104},[3118],{"type":38,"value":3119},"params",{"type":33,"tag":64,"props":3121,"children":3122},{"style":87},[3123],{"type":38,"value":1484},{"type":33,"tag":64,"props":3125,"children":3126},{"class":66,"line":323},[3127,3131,3136,3140,3144,3149],{"type":33,"tag":64,"props":3128,"children":3129},{"style":110},[3130],{"type":38,"value":207},{"type":33,"tag":64,"props":3132,"children":3133},{"style":210},[3134],{"type":38,"value":3135}," product",{"type":33,"tag":64,"props":3137,"children":3138},{"style":110},[3139],{"type":38,"value":218},{"type":33,"tag":64,"props":3141,"children":3142},{"style":110},[3143],{"type":38,"value":2047},{"type":33,"tag":64,"props":3145,"children":3146},{"style":81},[3147],{"type":38,"value":3148}," getProduct",{"type":33,"tag":64,"props":3150,"children":3151},{"style":87},[3152],{"type":38,"value":3153},"(params.slug)\n",{"type":33,"tag":64,"props":3155,"children":3156},{"class":66,"line":332},[3157],{"type":33,"tag":64,"props":3158,"children":3159},{"style":87},[3160],{"type":38,"value":329},{"type":33,"tag":64,"props":3162,"children":3163},{"class":66,"line":388},[3164,3168],{"type":33,"tag":64,"props":3165,"children":3166},{"style":110},[3167],{"type":38,"value":770},{"type":33,"tag":64,"props":3169,"children":3170},{"style":87},[3171],{"type":38,"value":1716},{"type":33,"tag":64,"props":3173,"children":3174},{"class":66,"line":396},[3175,3180,3185],{"type":33,"tag":64,"props":3176,"children":3177},{"style":87},[3178],{"type":38,"value":3179},"    \u003C",{"type":33,"tag":64,"props":3181,"children":3182},{"style":858},[3183],{"type":38,"value":3184},"div",{"type":33,"tag":64,"props":3186,"children":3187},{"style":87},[3188],{"type":38,"value":3189},">\n",{"type":33,"tag":64,"props":3191,"children":3192},{"class":66,"line":439},[3193,3197,3202,3207,3211],{"type":33,"tag":64,"props":3194,"children":3195},{"style":87},[3196],{"type":38,"value":1732},{"type":33,"tag":64,"props":3198,"children":3199},{"style":858},[3200],{"type":38,"value":3201},"h1",{"type":33,"tag":64,"props":3203,"children":3204},{"style":87},[3205],{"type":38,"value":3206},">{product.title}\u003C\u002F",{"type":33,"tag":64,"props":3208,"children":3209},{"style":858},[3210],{"type":38,"value":3201},{"type":33,"tag":64,"props":3212,"children":3213},{"style":87},[3214],{"type":38,"value":3189},{"type":33,"tag":64,"props":3216,"children":3217},{"class":66,"line":448},[3218,3222,3227,3232,3236,3241,3246,3250,3255,3260],{"type":33,"tag":64,"props":3219,"children":3220},{"style":87},[3221],{"type":38,"value":1732},{"type":33,"tag":64,"props":3223,"children":3224},{"style":210},[3225],{"type":38,"value":3226},"Image",{"type":33,"tag":64,"props":3228,"children":3229},{"style":81},[3230],{"type":38,"value":3231}," src",{"type":33,"tag":64,"props":3233,"children":3234},{"style":110},[3235],{"type":38,"value":606},{"type":33,"tag":64,"props":3237,"children":3238},{"style":87},[3239],{"type":38,"value":3240},"{product.image} ",{"type":33,"tag":64,"props":3242,"children":3243},{"style":81},[3244],{"type":38,"value":3245},"alt",{"type":33,"tag":64,"props":3247,"children":3248},{"style":110},[3249],{"type":38,"value":606},{"type":33,"tag":64,"props":3251,"children":3252},{"style":87},[3253],{"type":38,"value":3254},"{product.title} ",{"type":33,"tag":64,"props":3256,"children":3257},{"style":81},[3258],{"type":38,"value":3259},"priority",{"type":33,"tag":64,"props":3261,"children":3262},{"style":87},[3263],{"type":38,"value":3264}," \u002F>\n",{"type":33,"tag":64,"props":3266,"children":3267},{"class":66,"line":481},[3268,3272,3277,3282,3286],{"type":33,"tag":64,"props":3269,"children":3270},{"style":87},[3271],{"type":38,"value":1732},{"type":33,"tag":64,"props":3273,"children":3274},{"style":210},[3275],{"type":38,"value":3276},"AddToCartButton",{"type":33,"tag":64,"props":3278,"children":3279},{"style":81},[3280],{"type":38,"value":3281}," productId",{"type":33,"tag":64,"props":3283,"children":3284},{"style":110},[3285],{"type":38,"value":606},{"type":33,"tag":64,"props":3287,"children":3288},{"style":87},[3289],{"type":38,"value":3290},"{product.id} \u002F>\n",{"type":33,"tag":64,"props":3292,"children":3293},{"class":66,"line":499},[3294,3299,3303],{"type":33,"tag":64,"props":3295,"children":3296},{"style":87},[3297],{"type":38,"value":3298},"    \u003C\u002F",{"type":33,"tag":64,"props":3300,"children":3301},{"style":858},[3302],{"type":38,"value":3184},{"type":33,"tag":64,"props":3304,"children":3305},{"style":87},[3306],{"type":38,"value":3189},{"type":33,"tag":64,"props":3308,"children":3309},{"class":66,"line":508},[3310],{"type":33,"tag":64,"props":3311,"children":3312},{"style":87},[3313],{"type":38,"value":1832},{"type":33,"tag":64,"props":3315,"children":3316},{"class":66,"line":537},[3317],{"type":33,"tag":64,"props":3318,"children":3319},{"style":87},[3320],{"type":38,"value":552},{"type":33,"tag":34,"props":3322,"children":3323},{},[3324],{"type":38,"value":3325},"With this setup, the top 100 products generate at build time, remaining products render on-demand and cache for 1 hour. LCP drops below 1.2s because HTML is pre-rendered and only image loading remains.",{"type":33,"tag":34,"props":3327,"children":3328},{},[3329],{"type":38,"value":3330},"Also measure runtime cost: serverless function invocation count × execution time × pricing. On Vercel, if an average SSR page takes 50ms and you serve 100,000 page views daily: 100k × 50ms = 5 million GB-s, which equals $25\u002Fday (Vercel Pro pricing). To reduce this:",{"type":33,"tag":3332,"props":3333,"children":3334},"ol",{},[3335,3347,3352],{"type":33,"tag":3336,"props":3337,"children":3338},"li",{},[3339,3341],{"type":38,"value":3340},"Edge caching—activate CDN cache on Cloudflare with ",{"type":33,"tag":60,"props":3342,"children":3344},{"className":3343},[],[3345],{"type":38,"value":3346},"Cache-Control: s-maxage=3600",{"type":33,"tag":3336,"props":3348,"children":3349},{},[3350],{"type":38,"value":3351},"Partial hydration—use Astro or Qwik, hydrate only interactive components",{"type":33,"tag":3336,"props":3353,"children":3354},{},[3355,3357,3363],{"type":38,"value":3356},"Database query optimization—fix N+1 problems with Prisma's ",{"type":33,"tag":60,"props":3358,"children":3360},{"className":3359},[],[3361],{"type":38,"value":3362},"include",{"type":38,"value":3364},", reduce 10 queries to 1",{"type":33,"tag":1026,"props":3366,"children":3367},{},[3368,3393],{"type":33,"tag":1030,"props":3369,"children":3370},{},[3371],{"type":33,"tag":1034,"props":3372,"children":3373},{},[3374,3379,3383,3388],{"type":33,"tag":1038,"props":3375,"children":3376},{},[3377],{"type":38,"value":3378},"Metric",{"type":33,"tag":1038,"props":3380,"children":3381},{},[3382],{"type":38,"value":1042},{"type":33,"tag":1038,"props":3384,"children":3385},{},[3386],{"type":38,"value":3387},"New (Next.js SSR)",{"type":33,"tag":1038,"props":3389,"children":3390},{},[3391],{"type":38,"value":3392},"Target",{"type":33,"tag":1054,"props":3394,"children":3395},{},[3396,3419,3442,3465,3488],{"type":33,"tag":1034,"props":3397,"children":3398},{},[3399,3404,3409,3414],{"type":33,"tag":1061,"props":3400,"children":3401},{},[3402],{"type":38,"value":3403},"LCP",{"type":33,"tag":1061,"props":3405,"children":3406},{},[3407],{"type":38,"value":3408},"2.3s",{"type":33,"tag":1061,"props":3410,"children":3411},{},[3412],{"type":38,"value":3413},"1.8s",{"type":33,"tag":1061,"props":3415,"children":3416},{},[3417],{"type":38,"value":3418},"\u003C2.5s",{"type":33,"tag":1034,"props":3420,"children":3421},{},[3422,3427,3432,3437],{"type":33,"tag":1061,"props":3423,"children":3424},{},[3425],{"type":38,"value":3426},"TBT",{"type":33,"tag":1061,"props":3428,"children":3429},{},[3430],{"type":38,"value":3431},"190ms",{"type":33,"tag":1061,"props":3433,"children":3434},{},[3435],{"type":38,"value":3436},"120ms",{"type":33,"tag":1061,"props":3438,"children":3439},{},[3440],{"type":38,"value":3441},"\u003C200ms",{"type":33,"tag":1034,"props":3443,"children":3444},{},[3445,3450,3455,3460],{"type":33,"tag":1061,"props":3446,"children":3447},{},[3448],{"type":38,"value":3449},"CLS",{"type":33,"tag":1061,"props":3451,"children":3452},{},[3453],{"type":38,"value":3454},"0.08",{"type":33,"tag":1061,"props":3456,"children":3457},{},[3458],{"type":38,"value":3459},"0.02",{"type":33,"tag":1061,"props":3461,"children":3462},{},[3463],{"type":38,"value":3464},"\u003C0.1",{"type":33,"tag":1034,"props":3466,"children":3467},{},[3468,3473,3478,3483],{"type":33,"tag":1061,"props":3469,"children":3470},{},[3471],{"type":38,"value":3472},"Server response time",{"type":33,"tag":1061,"props":3474,"children":3475},{},[3476],{"type":38,"value":3477},"420ms",{"type":33,"tag":1061,"props":3479,"children":3480},{},[3481],{"type":38,"value":3482},"180ms",{"type":33,"tag":1061,"props":3484,"children":3485},{},[3486],{"type":38,"value":3487},"\u003C300ms",{"type":33,"tag":1034,"props":3489,"children":3490},{},[3491,3496,3501,3506],{"type":33,"tag":1061,"props":3492,"children":3493},{},[3494],{"type":38,"value":3495},"Monthly runtime cost",{"type":33,"tag":1061,"props":3497,"children":3498},{},[3499],{"type":38,"value":3500},"$0 (included)",{"type":33,"tag":1061,"props":3502,"children":3503},{},[3504],{"type":38,"value":3505},"$750 (Vercel Pro)",{"type":33,"tag":1061,"props":3507,"children":3508},{},[3509],{"type":38,"value":3510},"\u003C$1000",{"type":33,"tag":41,"props":3512,"children":3514},{"id":3513},"rollback-strategy-and-dual-run-period",[3515],{"type":38,"value":3516},"Rollback Strategy and Dual-Run Period",{"type":33,"tag":34,"props":3518,"children":3519},{},[3520],{"type":38,"value":3521},"The final migration phase is dual-run: both systems operate in parallel for 30 days with canary deployment gradually shifting traffic. During this window, run in \"shadow mode\"—the headless system isn't yet production but processes every request in the background and logs results. This tests production traffic without exposing users to failures.",{"type":33,"tag":34,"props":3523,"children":3524},{},[3525],{"type":38,"value":3526},"Shadow mode implementation:",{"type":33,"tag":53,"props":3528,"children":3530},{"className":55,"code":3529,"language":57,"meta":16,"style":16},"\u002F\u002F Cloudflare Worker: Shadow request to headless\naddEventListener('fetch', event => {\n  event.respondWith(handleRequest(event.request))\n})\n\nasync function handleRequest(request) {\n  const legacyResponse = fetch('https:\u002F\u002Flegacy-origin.example.com' + new URL(request.url).pathname, request)\n  \n  \u002F\u002F Async shadow request to headless (result ignored)\n  event.waitUntil(\n    fetch('https:\u002F\u002Fheadless-origin.example.com' + new URL(request.url).pathname, request.clone())\n      .then(res => logShadowResult(request.url, res.status, res.headers.get('x-response-time')))\n      .catch(err => logShadowError(request.url, err.message))\n  )\n  \n  return legacyResponse\n}\n",[3531],{"type":33,"tag":60,"props":3532,"children":3533},{"__ignoreMap":16},[3534,3542,3573,3596,3603,3610,3637,3682,3689,3697,3714,3757,3811,3845,3852,3859,3871],{"type":33,"tag":64,"props":3535,"children":3536},{"class":66,"line":67},[3537],{"type":33,"tag":64,"props":3538,"children":3539},{"style":71},[3540],{"type":38,"value":3541},"\u002F\u002F Cloudflare Worker: Shadow request to headless\n",{"type":33,"tag":64,"props":3543,"children":3544},{"class":66,"line":77},[3545,3549,3553,3557,3561,3565,3569],{"type":33,"tag":64,"props":3546,"children":3547},{"style":81},[3548],{"type":38,"value":84},{"type":33,"tag":64,"props":3550,"children":3551},{"style":87},[3552],{"type":38,"value":90},{"type":33,"tag":64,"props":3554,"children":3555},{"style":93},[3556],{"type":38,"value":96},{"type":33,"tag":64,"props":3558,"children":3559},{"style":87},[3560],{"type":38,"value":101},{"type":33,"tag":64,"props":3562,"children":3563},{"style":104},[3564],{"type":38,"value":107},{"type":33,"tag":64,"props":3566,"children":3567},{"style":110},[3568],{"type":38,"value":113},{"type":33,"tag":64,"props":3570,"children":3571},{"style":87},[3572],{"type":38,"value":118},{"type":33,"tag":64,"props":3574,"children":3575},{"class":66,"line":121},[3576,3580,3584,3588,3592],{"type":33,"tag":64,"props":3577,"children":3578},{"style":87},[3579],{"type":38,"value":127},{"type":33,"tag":64,"props":3581,"children":3582},{"style":81},[3583],{"type":38,"value":132},{"type":33,"tag":64,"props":3585,"children":3586},{"style":87},[3587],{"type":38,"value":90},{"type":33,"tag":64,"props":3589,"children":3590},{"style":81},[3591],{"type":38,"value":141},{"type":33,"tag":64,"props":3593,"children":3594},{"style":87},[3595],{"type":38,"value":146},{"type":33,"tag":64,"props":3597,"children":3598},{"class":66,"line":149},[3599],{"type":33,"tag":64,"props":3600,"children":3601},{"style":87},[3602],{"type":38,"value":155},{"type":33,"tag":64,"props":3604,"children":3605},{"class":66,"line":158},[3606],{"type":33,"tag":64,"props":3607,"children":3608},{"emptyLinePlaceholder":162},[3609],{"type":38,"value":165},{"type":33,"tag":64,"props":3611,"children":3612},{"class":66,"line":168},[3613,3617,3621,3625,3629,3633],{"type":33,"tag":64,"props":3614,"children":3615},{"style":110},[3616],{"type":38,"value":174},{"type":33,"tag":64,"props":3618,"children":3619},{"style":110},[3620],{"type":38,"value":179},{"type":33,"tag":64,"props":3622,"children":3623},{"style":81},[3624],{"type":38,"value":184},{"type":33,"tag":64,"props":3626,"children":3627},{"style":87},[3628],{"type":38,"value":90},{"type":33,"tag":64,"props":3630,"children":3631},{"style":104},[3632],{"type":38,"value":193},{"type":33,"tag":64,"props":3634,"children":3635},{"style":87},[3636],{"type":38,"value":198},{"type":33,"tag":64,"props":3638,"children":3639},{"class":66,"line":201},[3640,3644,3649,3653,3657,3661,3665,3669,3673,3677],{"type":33,"tag":64,"props":3641,"children":3642},{"style":110},[3643],{"type":38,"value":207},{"type":33,"tag":64,"props":3645,"children":3646},{"style":210},[3647],{"type":38,"value":3648}," legacyResponse",{"type":33,"tag":64,"props":3650,"children":3651},{"style":110},[3652],{"type":38,"value":218},{"type":33,"tag":64,"props":3654,"children":3655},{"style":81},[3656],{"type":38,"value":459},{"type":33,"tag":64,"props":3658,"children":3659},{"style":87},[3660],{"type":38,"value":90},{"type":33,"tag":64,"props":3662,"children":3663},{"style":93},[3664],{"type":38,"value":526},{"type":33,"tag":64,"props":3666,"children":3667},{"style":110},[3668],{"type":38,"value":473},{"type":33,"tag":64,"props":3670,"children":3671},{"style":110},[3672],{"type":38,"value":223},{"type":33,"tag":64,"props":3674,"children":3675},{"style":81},[3676],{"type":38,"value":228},{"type":33,"tag":64,"props":3678,"children":3679},{"style":87},[3680],{"type":38,"value":3681},"(request.url).pathname, request)\n",{"type":33,"tag":64,"props":3683,"children":3684},{"class":66,"line":27},[3685],{"type":33,"tag":64,"props":3686,"children":3687},{"style":87},[3688],{"type":38,"value":329},{"type":33,"tag":64,"props":3690,"children":3691},{"class":66,"line":296},[3692],{"type":33,"tag":64,"props":3693,"children":3694},{"style":71},[3695],{"type":38,"value":3696},"  \u002F\u002F Async shadow request to headless (result ignored)\n",{"type":33,"tag":64,"props":3698,"children":3699},{"class":66,"line":323},[3700,3704,3709],{"type":33,"tag":64,"props":3701,"children":3702},{"style":87},[3703],{"type":38,"value":127},{"type":33,"tag":64,"props":3705,"children":3706},{"style":81},[3707],{"type":38,"value":3708},"waitUntil",{"type":33,"tag":64,"props":3710,"children":3711},{"style":87},[3712],{"type":38,"value":3713},"(\n",{"type":33,"tag":64,"props":3715,"children":3716},{"class":66,"line":332},[3717,3722,3726,3730,3734,3738,3742,3747,3752],{"type":33,"tag":64,"props":3718,"children":3719},{"style":81},[3720],{"type":38,"value":3721},"    fetch",{"type":33,"tag":64,"props":3723,"children":3724},{"style":87},[3725],{"type":38,"value":90},{"type":33,"tag":64,"props":3727,"children":3728},{"style":93},[3729],{"type":38,"value":468},{"type":33,"tag":64,"props":3731,"children":3732},{"style":110},[3733],{"type":38,"value":473},{"type":33,"tag":64,"props":3735,"children":3736},{"style":110},[3737],{"type":38,"value":223},{"type":33,"tag":64,"props":3739,"children":3740},{"style":81},[3741],{"type":38,"value":228},{"type":33,"tag":64,"props":3743,"children":3744},{"style":87},[3745],{"type":38,"value":3746},"(request.url).pathname, request.",{"type":33,"tag":64,"props":3748,"children":3749},{"style":81},[3750],{"type":38,"value":3751},"clone",{"type":33,"tag":64,"props":3753,"children":3754},{"style":87},[3755],{"type":38,"value":3756},"())\n",{"type":33,"tag":64,"props":3758,"children":3759},{"class":66,"line":388},[3760,3765,3770,3774,3779,3783,3788,3793,3797,3801,3806],{"type":33,"tag":64,"props":3761,"children":3762},{"style":87},[3763],{"type":38,"value":3764},"      .",{"type":33,"tag":64,"props":3766,"children":3767},{"style":81},[3768],{"type":38,"value":3769},"then",{"type":33,"tag":64,"props":3771,"children":3772},{"style":87},[3773],{"type":38,"value":90},{"type":33,"tag":64,"props":3775,"children":3776},{"style":104},[3777],{"type":38,"value":3778},"res",{"type":33,"tag":64,"props":3780,"children":3781},{"style":110},[3782],{"type":38,"value":113},{"type":33,"tag":64,"props":3784,"children":3785},{"style":81},[3786],{"type":38,"value":3787}," logShadowResult",{"type":33,"tag":64,"props":3789,"children":3790},{"style":87},[3791],{"type":38,"value":3792},"(request.url, res.status, res.headers.",{"type":33,"tag":64,"props":3794,"children":3795},{"style":81},[3796],{"type":38,"value":259},{"type":33,"tag":64,"props":3798,"children":3799},{"style":87},[3800],{"type":38,"value":90},{"type":33,"tag":64,"props":3802,"children":3803},{"style":93},[3804],{"type":38,"value":3805},"'x-response-time'",{"type":33,"tag":64,"props":3807,"children":3808},{"style":87},[3809],{"type":38,"value":3810},")))\n",{"type":33,"tag":64,"props":3812,"children":3813},{"class":66,"line":396},[3814,3818,3822,3826,3831,3835,3840],{"type":33,"tag":64,"props":3815,"children":3816},{"style":87},[3817],{"type":38,"value":3764},{"type":33,"tag":64,"props":3819,"children":3820},{"style":81},[3821],{"type":38,"value":2341},{"type":33,"tag":64,"props":3823,"children":3824},{"style":87},[3825],{"type":38,"value":90},{"type":33,"tag":64,"props":3827,"children":3828},{"style":104},[3829],{"type":38,"value":3830},"err",{"type":33,"tag":64,"props":3832,"children":3833},{"style":110},[3834],{"type":38,"value":113},{"type":33,"tag":64,"props":3836,"children":3837},{"style":81},[3838],{"type":38,"value":3839}," logShadowError",{"type":33,"tag":64,"props":3841,"children":3842},{"style":87},[3843],{"type":38,"value":3844},"(request.url, err.message))\n",{"type":33,"tag":64,"props":3846,"children":3847},{"class":66,"line":439},[3848],{"type":33,"tag":64,"props":3849,"children":3850},{"style":87},[3851],{"type":38,"value":1832},{"type":33,"tag":64,"props":3853,"children":3854},{"class":66,"line":448},[3855],{"type":33,"tag":64,"props":3856,"children":3857},{"style":87},[3858],{"type":38,"value":329},{"type":33,"tag":64,"props":3860,"children":3861},{"class":66,"line":481},[3862,3866],{"type":33,"tag":64,"props":3863,"children":3864},{"style":110},[3865],{"type":38,"value":770},{"type":33,"tag":64,"props":3867,"children":3868},{"style":87},[3869],{"type":38,"value":3870}," legacyResponse\n",{"type":33,"tag":64,"props":3872,"children":3873},{"class":66,"line":499},[3874],{"type":33,"tag":64,"props":3875,"children":3876},{"style":87},[3877],{"type":38,"value":552},{"type":33,"tag":34,"props":3879,"children":3880},{},[3881],{"type":38,"value":3882},"After 30 days, review shadow logs. If the headless system shows 99.9% uptime and \u003C2s response time, proceed with full cutover.",{"type":33,"tag":34,"props":3884,"children":3885},{},[3886],{"type":38,"value":3887},"Keep rollback simple: flip your DNS CNAME back to the legacy origin and you're live within 2 minutes. This is why you don't decommission the legacy system immediately after migration—keep it in read-only mode for 90 days as a fast rollback safety net.",{"type":33,"tag":34,"props":3889,"children":3890},{},[3891],{"type":38,"value":3892},"Migrating to headless e-commerce is a manageable process with the right roadmap and continuous metric measurement. Phased rollout keeps traffic controlled, SEO preservation protects organic revenue, ATC monitoring preserves conversion funnel health. Stay disciplined throughout—favor incremental over big-bang, measurement over assumptions, rollback plans over hope—and you'll gain both performance and business continuity.",{"type":33,"tag":3894,"props":3895,"children":3896},"style",{},[3897],{"type":38,"value":3898},"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);}",{"title":16,"searchDepth":121,"depth":121,"links":3900},[3901,3904,3907,3910,3911],{"id":43,"depth":77,"text":46,"children":3902},[3903],{"id":822,"depth":121,"text":825},{"id":1011,"depth":77,"text":1014,"children":3905},[3906],{"id":1847,"depth":121,"text":1850},{"id":1885,"depth":77,"text":1888,"children":3908},[3909],{"id":2893,"depth":121,"text":2896},{"id":2904,"depth":77,"text":2907},{"id":3513,"depth":77,"text":3516},"markdown","content:en:tech:headless-ecommerce-migration-roadmap-risk-management.md","content","en\u002Ftech\u002Fheadless-ecommerce-migration-roadmap-risk-management.md","en\u002Ftech\u002Fheadless-ecommerce-migration-roadmap-risk-management","md",1783289072814]