[{"data":1,"prerenderedAt":3539},["ShallowReactive",2],{"article-alternates":3,"article-\u002Fit\u002Ftech\u002Fmigrazione-headless-e-commerce-roadmap-e-gestione-rischi":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":10,"_dir":14,"_draft":15,"_partial":15,"_locale":16,"title":17,"description":18,"publishedAt":19,"modifiedAt":19,"category":14,"i18nKey":4,"tags":20,"readingTime":26,"author":27,"body":28,"_type":3533,"_id":3534,"_source":3535,"_file":3536,"_stem":3537,"_extension":3538},"tech",false,"","Migrazione E-Commerce Headless: Roadmap e Gestione dei Rischi","Strategia di rollout in fasi, protezione SEO e analisi dell'abbandono del carrello per pianificare la transizione a e-commerce headless con dati concreti.","2026-06-28",[21,22,23,24,25],"headless-commerce","migrazione","seo-preservation","performance-optimization","gestione-rischi",9,"Roibase",{"type":29,"children":30,"toc":3520},"root",[31,39,46,51,792,805,818,825,830,1003,1008,1014,1019,1024,1134,1139,1409,1422,1831,1836,1842,1873,1879,1884,1889,2538,2543,2868,2881,2887,2892,2898,2903,2908,3311,3316,3321,3357,3503,3509,3514],{"type":32,"tag":33,"props":34,"children":35},"element","p",{},[36],{"type":37,"value":38},"text","La migrazione da una piattaforma e-commerce monolitica all'architettura headless non è una replatform notturna. Nel 2026, un sito e-commerce medio riceve oltre 50.000+ richieste al giorno, il 40% proviene da ricerca organica, e ogni secondo di inattività rappresenta una perdita di $5.000+. Considerando questi numeri, la strategia di migrazione richiede disciplina ingegneristica: rollout in fasi, protezione degli URL canonici, misurazione microscopica del flusso add-to-cart. In questo articolo condivideremo una roadmap collaudata per la migrazione headless, decisioni tecniche per prevenire il calo SEO e metriche per monitorare il tasso di abbandono del carrello con esempi di codice concreti.",{"type":32,"tag":40,"props":41,"children":43},"h2",{"id":42},"rollout-in-fasi-segmentazione-del-traffico-e-canary-deployment",[44],{"type":37,"value":45},"Rollout in Fasi: Segmentazione del Traffico e Canary Deployment",{"type":32,"tag":33,"props":47,"children":48},{},[49],{"type":37,"value":50},"La decisione più critica nella migrazione headless è: quale segmento di utenti indirizzare prima al nuovo sistema. Il deployment big-bang comporta il rischio di downtime al 100%; l'approccio corretto è segmentare il traffico a livello di CDN Edge. Con Cloudflare Workers, è possibile indirizzare il 5% dei nuovi utenti al frontend headless, mantenendo il resto sullo stack legacy.",{"type":32,"tag":52,"props":53,"children":57},"pre",{"className":54,"code":55,"language":56,"meta":16,"style":16},"language-javascript shiki shiki-themes github-dark","\u002F\u002F Cloudflare Worker: Routing headless in fasi\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 Indirizza il 5% a headless\n  \n  const isNewStack = (hashCode(userId) % 100) \u003C rolloutPercent\n  \n  if (isNewStack && url.pathname.startsWith('\u002Fproducts')) {\n    \u002F\u002F Indirizza all'origin headless Nuxt\u002FNext\n    return fetch('https:\u002F\u002Fheadless-origin.example.com' + url.pathname, request)\n  } else {\n    \u002F\u002F Origin Shopify Liquid legacy\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",[58],{"type":32,"tag":59,"props":60,"children":61},"code",{"__ignoreMap":16},[62,74,118,146,155,165,198,233,294,320,329,385,393,436,445,478,496,505,534,543,552,560,587,611,676,736,753,761,784],{"type":32,"tag":63,"props":64,"children":67},"span",{"class":65,"line":66},"line",1,[68],{"type":32,"tag":63,"props":69,"children":71},{"style":70},"--shiki-default:#6A737D",[72],{"type":37,"value":73},"\u002F\u002F Cloudflare Worker: Routing headless in fasi\n",{"type":32,"tag":63,"props":75,"children":77},{"class":65,"line":76},2,[78,84,90,96,101,107,113],{"type":32,"tag":63,"props":79,"children":81},{"style":80},"--shiki-default:#B392F0",[82],{"type":37,"value":83},"addEventListener",{"type":32,"tag":63,"props":85,"children":87},{"style":86},"--shiki-default:#E1E4E8",[88],{"type":37,"value":89},"(",{"type":32,"tag":63,"props":91,"children":93},{"style":92},"--shiki-default:#9ECBFF",[94],{"type":37,"value":95},"'fetch'",{"type":32,"tag":63,"props":97,"children":98},{"style":86},[99],{"type":37,"value":100},", ",{"type":32,"tag":63,"props":102,"children":104},{"style":103},"--shiki-default:#FFAB70",[105],{"type":37,"value":106},"event",{"type":32,"tag":63,"props":108,"children":110},{"style":109},"--shiki-default:#F97583",[111],{"type":37,"value":112}," =>",{"type":32,"tag":63,"props":114,"children":115},{"style":86},[116],{"type":37,"value":117}," {\n",{"type":32,"tag":63,"props":119,"children":121},{"class":65,"line":120},3,[122,127,132,136,141],{"type":32,"tag":63,"props":123,"children":124},{"style":86},[125],{"type":37,"value":126},"  event.",{"type":32,"tag":63,"props":128,"children":129},{"style":80},[130],{"type":37,"value":131},"respondWith",{"type":32,"tag":63,"props":133,"children":134},{"style":86},[135],{"type":37,"value":89},{"type":32,"tag":63,"props":137,"children":138},{"style":80},[139],{"type":37,"value":140},"handleRequest",{"type":32,"tag":63,"props":142,"children":143},{"style":86},[144],{"type":37,"value":145},"(event.request))\n",{"type":32,"tag":63,"props":147,"children":149},{"class":65,"line":148},4,[150],{"type":32,"tag":63,"props":151,"children":152},{"style":86},[153],{"type":37,"value":154},"})\n",{"type":32,"tag":63,"props":156,"children":158},{"class":65,"line":157},5,[159],{"type":32,"tag":63,"props":160,"children":162},{"emptyLinePlaceholder":161},true,[163],{"type":37,"value":164},"\n",{"type":32,"tag":63,"props":166,"children":168},{"class":65,"line":167},6,[169,174,179,184,188,193],{"type":32,"tag":63,"props":170,"children":171},{"style":109},[172],{"type":37,"value":173},"async",{"type":32,"tag":63,"props":175,"children":176},{"style":109},[177],{"type":37,"value":178}," function",{"type":32,"tag":63,"props":180,"children":181},{"style":80},[182],{"type":37,"value":183}," handleRequest",{"type":32,"tag":63,"props":185,"children":186},{"style":86},[187],{"type":37,"value":89},{"type":32,"tag":63,"props":189,"children":190},{"style":103},[191],{"type":37,"value":192},"request",{"type":32,"tag":63,"props":194,"children":195},{"style":86},[196],{"type":37,"value":197},") {\n",{"type":32,"tag":63,"props":199,"children":201},{"class":65,"line":200},7,[202,207,213,218,223,228],{"type":32,"tag":63,"props":203,"children":204},{"style":109},[205],{"type":37,"value":206},"  const",{"type":32,"tag":63,"props":208,"children":210},{"style":209},"--shiki-default:#79B8FF",[211],{"type":37,"value":212}," url",{"type":32,"tag":63,"props":214,"children":215},{"style":109},[216],{"type":37,"value":217}," =",{"type":32,"tag":63,"props":219,"children":220},{"style":109},[221],{"type":37,"value":222}," new",{"type":32,"tag":63,"props":224,"children":225},{"style":80},[226],{"type":37,"value":227}," URL",{"type":32,"tag":63,"props":229,"children":230},{"style":86},[231],{"type":37,"value":232},"(request.url)\n",{"type":32,"tag":63,"props":234,"children":236},{"class":65,"line":235},8,[237,241,246,250,255,260,264,269,274,279,284,289],{"type":32,"tag":63,"props":238,"children":239},{"style":109},[240],{"type":37,"value":206},{"type":32,"tag":63,"props":242,"children":243},{"style":209},[244],{"type":37,"value":245}," userId",{"type":32,"tag":63,"props":247,"children":248},{"style":109},[249],{"type":37,"value":217},{"type":32,"tag":63,"props":251,"children":252},{"style":86},[253],{"type":37,"value":254}," request.headers.",{"type":32,"tag":63,"props":256,"children":257},{"style":80},[258],{"type":37,"value":259},"get",{"type":32,"tag":63,"props":261,"children":262},{"style":86},[263],{"type":37,"value":89},{"type":32,"tag":63,"props":265,"children":266},{"style":92},[267],{"type":37,"value":268},"'X-User-ID'",{"type":32,"tag":63,"props":270,"children":271},{"style":86},[272],{"type":37,"value":273},") ",{"type":32,"tag":63,"props":275,"children":276},{"style":109},[277],{"type":37,"value":278},"||",{"type":32,"tag":63,"props":280,"children":281},{"style":86},[282],{"type":37,"value":283}," Math.",{"type":32,"tag":63,"props":285,"children":286},{"style":80},[287],{"type":37,"value":288},"random",{"type":32,"tag":63,"props":290,"children":291},{"style":86},[292],{"type":37,"value":293},"()\n",{"type":32,"tag":63,"props":295,"children":296},{"class":65,"line":26},[297,301,306,310,315],{"type":32,"tag":63,"props":298,"children":299},{"style":109},[300],{"type":37,"value":206},{"type":32,"tag":63,"props":302,"children":303},{"style":209},[304],{"type":37,"value":305}," rolloutPercent",{"type":32,"tag":63,"props":307,"children":308},{"style":109},[309],{"type":37,"value":217},{"type":32,"tag":63,"props":311,"children":312},{"style":209},[313],{"type":37,"value":314}," 5",{"type":32,"tag":63,"props":316,"children":317},{"style":70},[318],{"type":37,"value":319}," \u002F\u002F Indirizza il 5% a headless\n",{"type":32,"tag":63,"props":321,"children":323},{"class":65,"line":322},10,[324],{"type":32,"tag":63,"props":325,"children":326},{"style":86},[327],{"type":37,"value":328},"  \n",{"type":32,"tag":63,"props":330,"children":332},{"class":65,"line":331},11,[333,337,342,346,351,356,361,366,371,375,380],{"type":32,"tag":63,"props":334,"children":335},{"style":109},[336],{"type":37,"value":206},{"type":32,"tag":63,"props":338,"children":339},{"style":209},[340],{"type":37,"value":341}," isNewStack",{"type":32,"tag":63,"props":343,"children":344},{"style":109},[345],{"type":37,"value":217},{"type":32,"tag":63,"props":347,"children":348},{"style":86},[349],{"type":37,"value":350}," (",{"type":32,"tag":63,"props":352,"children":353},{"style":80},[354],{"type":37,"value":355},"hashCode",{"type":32,"tag":63,"props":357,"children":358},{"style":86},[359],{"type":37,"value":360},"(userId) ",{"type":32,"tag":63,"props":362,"children":363},{"style":109},[364],{"type":37,"value":365},"%",{"type":32,"tag":63,"props":367,"children":368},{"style":209},[369],{"type":37,"value":370}," 100",{"type":32,"tag":63,"props":372,"children":373},{"style":86},[374],{"type":37,"value":273},{"type":32,"tag":63,"props":376,"children":377},{"style":109},[378],{"type":37,"value":379},"\u003C",{"type":32,"tag":63,"props":381,"children":382},{"style":86},[383],{"type":37,"value":384}," rolloutPercent\n",{"type":32,"tag":63,"props":386,"children":388},{"class":65,"line":387},12,[389],{"type":32,"tag":63,"props":390,"children":391},{"style":86},[392],{"type":37,"value":328},{"type":32,"tag":63,"props":394,"children":396},{"class":65,"line":395},13,[397,402,407,412,417,422,426,431],{"type":32,"tag":63,"props":398,"children":399},{"style":109},[400],{"type":37,"value":401},"  if",{"type":32,"tag":63,"props":403,"children":404},{"style":86},[405],{"type":37,"value":406}," (isNewStack ",{"type":32,"tag":63,"props":408,"children":409},{"style":109},[410],{"type":37,"value":411},"&&",{"type":32,"tag":63,"props":413,"children":414},{"style":86},[415],{"type":37,"value":416}," url.pathname.",{"type":32,"tag":63,"props":418,"children":419},{"style":80},[420],{"type":37,"value":421},"startsWith",{"type":32,"tag":63,"props":423,"children":424},{"style":86},[425],{"type":37,"value":89},{"type":32,"tag":63,"props":427,"children":428},{"style":92},[429],{"type":37,"value":430},"'\u002Fproducts'",{"type":32,"tag":63,"props":432,"children":433},{"style":86},[434],{"type":37,"value":435},")) {\n",{"type":32,"tag":63,"props":437,"children":439},{"class":65,"line":438},14,[440],{"type":32,"tag":63,"props":441,"children":442},{"style":70},[443],{"type":37,"value":444},"    \u002F\u002F Indirizza all'origin headless Nuxt\u002FNext\n",{"type":32,"tag":63,"props":446,"children":448},{"class":65,"line":447},15,[449,454,459,463,468,473],{"type":32,"tag":63,"props":450,"children":451},{"style":109},[452],{"type":37,"value":453},"    return",{"type":32,"tag":63,"props":455,"children":456},{"style":80},[457],{"type":37,"value":458}," fetch",{"type":32,"tag":63,"props":460,"children":461},{"style":86},[462],{"type":37,"value":89},{"type":32,"tag":63,"props":464,"children":465},{"style":92},[466],{"type":37,"value":467},"'https:\u002F\u002Fheadless-origin.example.com'",{"type":32,"tag":63,"props":469,"children":470},{"style":109},[471],{"type":37,"value":472}," +",{"type":32,"tag":63,"props":474,"children":475},{"style":86},[476],{"type":37,"value":477}," url.pathname, request)\n",{"type":32,"tag":63,"props":479,"children":481},{"class":65,"line":480},16,[482,487,492],{"type":32,"tag":63,"props":483,"children":484},{"style":86},[485],{"type":37,"value":486},"  } ",{"type":32,"tag":63,"props":488,"children":489},{"style":109},[490],{"type":37,"value":491},"else",{"type":32,"tag":63,"props":493,"children":494},{"style":86},[495],{"type":37,"value":117},{"type":32,"tag":63,"props":497,"children":499},{"class":65,"line":498},17,[500],{"type":32,"tag":63,"props":501,"children":502},{"style":70},[503],{"type":37,"value":504},"    \u002F\u002F Origin Shopify Liquid legacy\n",{"type":32,"tag":63,"props":506,"children":508},{"class":65,"line":507},18,[509,513,517,521,526,530],{"type":32,"tag":63,"props":510,"children":511},{"style":109},[512],{"type":37,"value":453},{"type":32,"tag":63,"props":514,"children":515},{"style":80},[516],{"type":37,"value":458},{"type":32,"tag":63,"props":518,"children":519},{"style":86},[520],{"type":37,"value":89},{"type":32,"tag":63,"props":522,"children":523},{"style":92},[524],{"type":37,"value":525},"'https:\u002F\u002Flegacy-origin.example.com'",{"type":32,"tag":63,"props":527,"children":528},{"style":109},[529],{"type":37,"value":472},{"type":32,"tag":63,"props":531,"children":532},{"style":86},[533],{"type":37,"value":477},{"type":32,"tag":63,"props":535,"children":537},{"class":65,"line":536},19,[538],{"type":32,"tag":63,"props":539,"children":540},{"style":86},[541],{"type":37,"value":542},"  }\n",{"type":32,"tag":63,"props":544,"children":546},{"class":65,"line":545},20,[547],{"type":32,"tag":63,"props":548,"children":549},{"style":86},[550],{"type":37,"value":551},"}\n",{"type":32,"tag":63,"props":553,"children":555},{"class":65,"line":554},21,[556],{"type":32,"tag":63,"props":557,"children":558},{"emptyLinePlaceholder":161},[559],{"type":37,"value":164},{"type":32,"tag":63,"props":561,"children":563},{"class":65,"line":562},22,[564,569,574,578,583],{"type":32,"tag":63,"props":565,"children":566},{"style":109},[567],{"type":37,"value":568},"function",{"type":32,"tag":63,"props":570,"children":571},{"style":80},[572],{"type":37,"value":573}," hashCode",{"type":32,"tag":63,"props":575,"children":576},{"style":86},[577],{"type":37,"value":89},{"type":32,"tag":63,"props":579,"children":580},{"style":103},[581],{"type":37,"value":582},"str",{"type":32,"tag":63,"props":584,"children":585},{"style":86},[586],{"type":37,"value":197},{"type":32,"tag":63,"props":588,"children":590},{"class":65,"line":589},23,[591,596,601,606],{"type":32,"tag":63,"props":592,"children":593},{"style":109},[594],{"type":37,"value":595},"  let",{"type":32,"tag":63,"props":597,"children":598},{"style":86},[599],{"type":37,"value":600}," hash ",{"type":32,"tag":63,"props":602,"children":603},{"style":109},[604],{"type":37,"value":605},"=",{"type":32,"tag":63,"props":607,"children":608},{"style":209},[609],{"type":37,"value":610}," 0\n",{"type":32,"tag":63,"props":612,"children":614},{"class":65,"line":613},24,[615,620,624,629,634,638,643,648,652,657,662,667,672],{"type":32,"tag":63,"props":616,"children":617},{"style":109},[618],{"type":37,"value":619},"  for",{"type":32,"tag":63,"props":621,"children":622},{"style":86},[623],{"type":37,"value":350},{"type":32,"tag":63,"props":625,"children":626},{"style":109},[627],{"type":37,"value":628},"let",{"type":32,"tag":63,"props":630,"children":631},{"style":86},[632],{"type":37,"value":633}," i ",{"type":32,"tag":63,"props":635,"children":636},{"style":109},[637],{"type":37,"value":605},{"type":32,"tag":63,"props":639,"children":640},{"style":209},[641],{"type":37,"value":642}," 0",{"type":32,"tag":63,"props":644,"children":645},{"style":86},[646],{"type":37,"value":647},"; i ",{"type":32,"tag":63,"props":649,"children":650},{"style":109},[651],{"type":37,"value":379},{"type":32,"tag":63,"props":653,"children":654},{"style":86},[655],{"type":37,"value":656}," str.",{"type":32,"tag":63,"props":658,"children":659},{"style":209},[660],{"type":37,"value":661},"length",{"type":32,"tag":63,"props":663,"children":664},{"style":86},[665],{"type":37,"value":666},"; i",{"type":32,"tag":63,"props":668,"children":669},{"style":109},[670],{"type":37,"value":671},"++",{"type":32,"tag":63,"props":673,"children":674},{"style":86},[675],{"type":37,"value":197},{"type":32,"tag":63,"props":677,"children":679},{"class":65,"line":678},25,[680,685,689,694,699,703,707,712,717,722,726,731],{"type":32,"tag":63,"props":681,"children":682},{"style":86},[683],{"type":37,"value":684},"    hash ",{"type":32,"tag":63,"props":686,"children":687},{"style":109},[688],{"type":37,"value":605},{"type":32,"tag":63,"props":690,"children":691},{"style":86},[692],{"type":37,"value":693}," ((hash ",{"type":32,"tag":63,"props":695,"children":696},{"style":109},[697],{"type":37,"value":698},"\u003C\u003C",{"type":32,"tag":63,"props":700,"children":701},{"style":209},[702],{"type":37,"value":314},{"type":32,"tag":63,"props":704,"children":705},{"style":86},[706],{"type":37,"value":273},{"type":32,"tag":63,"props":708,"children":709},{"style":109},[710],{"type":37,"value":711},"-",{"type":32,"tag":63,"props":713,"children":714},{"style":86},[715],{"type":37,"value":716}," hash) ",{"type":32,"tag":63,"props":718,"children":719},{"style":109},[720],{"type":37,"value":721},"+",{"type":32,"tag":63,"props":723,"children":724},{"style":86},[725],{"type":37,"value":656},{"type":32,"tag":63,"props":727,"children":728},{"style":80},[729],{"type":37,"value":730},"charCodeAt",{"type":32,"tag":63,"props":732,"children":733},{"style":86},[734],{"type":37,"value":735},"(i)\n",{"type":32,"tag":63,"props":737,"children":739},{"class":65,"line":738},26,[740,744,749],{"type":32,"tag":63,"props":741,"children":742},{"style":86},[743],{"type":37,"value":684},{"type":32,"tag":63,"props":745,"children":746},{"style":109},[747],{"type":37,"value":748},"|=",{"type":32,"tag":63,"props":750,"children":751},{"style":209},[752],{"type":37,"value":610},{"type":32,"tag":63,"props":754,"children":756},{"class":65,"line":755},27,[757],{"type":32,"tag":63,"props":758,"children":759},{"style":86},[760],{"type":37,"value":542},{"type":32,"tag":63,"props":762,"children":764},{"class":65,"line":763},28,[765,770,774,779],{"type":32,"tag":63,"props":766,"children":767},{"style":109},[768],{"type":37,"value":769},"  return",{"type":32,"tag":63,"props":771,"children":772},{"style":86},[773],{"type":37,"value":283},{"type":32,"tag":63,"props":775,"children":776},{"style":80},[777],{"type":37,"value":778},"abs",{"type":32,"tag":63,"props":780,"children":781},{"style":86},[782],{"type":37,"value":783},"(hash)\n",{"type":32,"tag":63,"props":785,"children":787},{"class":65,"line":786},29,[788],{"type":32,"tag":63,"props":789,"children":790},{"style":86},[791],{"type":37,"value":551},{"type":32,"tag":33,"props":793,"children":794},{},[795,797,803],{"type":37,"value":796},"In questo approccio, si aumenta progressivamente ",{"type":32,"tag":59,"props":798,"children":800},{"className":799},[],[801],{"type":37,"value":802},"rolloutPercent",{"type":37,"value":804},": 5% → 25% → 50% → 100%. Dopo ogni fase, si attende 72 ore e si controllano i KPI prima di procedere. Focalizzarsi sui metriche critiche: se il Largest Contentful Paint (LCP) nello stack legacy è 2,3s, dovrebbe scendere a 1,8s nel sistema headless; se il tasso di successo add-to-cart scende sotto il 99,2%, si esegue il rollback.",{"type":32,"tag":33,"props":806,"children":807},{},[808,810,816],{"type":37,"value":809},"La seconda dimensione del rollout in fasi è la segmentazione geografica: iniziare da una regione a basso traffico (ad esempio, Europa Centrale) e procedere verso i principali mercati come Stati Uniti e Turchia. Utilizzando l'header ",{"type":32,"tag":59,"props":811,"children":813},{"className":812},[],[814],{"type":37,"value":815},"request.cf.country",{"type":37,"value":817}," di Cloudflare, è possibile implementare il routing basato sul paese.",{"type":32,"tag":819,"props":820,"children":822},"h3",{"id":821},"canary-deployment-e-rollback-automatico",[823],{"type":37,"value":824},"Canary Deployment e Rollback Automatico",{"type":32,"tag":33,"props":826,"children":827},{},[828],{"type":37,"value":829},"Configurare un meccanismo di rollback automatico nella pipeline di deployment. Se si utilizza Vercel o Netlify, aggiungere un health check personalizzato al webhook di deployment:",{"type":32,"tag":52,"props":831,"children":835},{"className":832,"code":833,"language":834,"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",[836],{"type":32,"tag":59,"props":837,"children":838},{"__ignoreMap":16},[839,847,871,888,895,915,931,939,947,955,963,971,979,987,995],{"type":32,"tag":63,"props":840,"children":841},{"class":65,"line":66},[842],{"type":32,"tag":63,"props":843,"children":844},{"style":70},[845],{"type":37,"value":846},"# .github\u002Fworkflows\u002Fdeploy-headless.yml\n",{"type":32,"tag":63,"props":848,"children":849},{"class":65,"line":76},[850,855,861,866],{"type":32,"tag":63,"props":851,"children":852},{"style":86},[853],{"type":37,"value":854},"- ",{"type":32,"tag":63,"props":856,"children":858},{"style":857},"--shiki-default:#85E89D",[859],{"type":37,"value":860},"name",{"type":32,"tag":63,"props":862,"children":863},{"style":86},[864],{"type":37,"value":865},": ",{"type":32,"tag":63,"props":867,"children":868},{"style":92},[869],{"type":37,"value":870},"Deploy to production\n",{"type":32,"tag":63,"props":872,"children":873},{"class":65,"line":120},[874,879,883],{"type":32,"tag":63,"props":875,"children":876},{"style":857},[877],{"type":37,"value":878},"  run",{"type":32,"tag":63,"props":880,"children":881},{"style":86},[882],{"type":37,"value":865},{"type":32,"tag":63,"props":884,"children":885},{"style":92},[886],{"type":37,"value":887},"vercel --prod\n",{"type":32,"tag":63,"props":889,"children":890},{"class":65,"line":148},[891],{"type":32,"tag":63,"props":892,"children":893},{"style":86},[894],{"type":37,"value":328},{"type":32,"tag":63,"props":896,"children":897},{"class":65,"line":157},[898,902,906,910],{"type":32,"tag":63,"props":899,"children":900},{"style":86},[901],{"type":37,"value":854},{"type":32,"tag":63,"props":903,"children":904},{"style":857},[905],{"type":37,"value":860},{"type":32,"tag":63,"props":907,"children":908},{"style":86},[909],{"type":37,"value":865},{"type":32,"tag":63,"props":911,"children":912},{"style":92},[913],{"type":37,"value":914},"Health check (30s probe)\n",{"type":32,"tag":63,"props":916,"children":917},{"class":65,"line":167},[918,922,926],{"type":32,"tag":63,"props":919,"children":920},{"style":857},[921],{"type":37,"value":878},{"type":32,"tag":63,"props":923,"children":924},{"style":86},[925],{"type":37,"value":865},{"type":32,"tag":63,"props":927,"children":928},{"style":109},[929],{"type":37,"value":930},"|\n",{"type":32,"tag":63,"props":932,"children":933},{"class":65,"line":200},[934],{"type":32,"tag":63,"props":935,"children":936},{"style":92},[937],{"type":37,"value":938},"    for i in {1..6}; do\n",{"type":32,"tag":63,"props":940,"children":941},{"class":65,"line":235},[942],{"type":32,"tag":63,"props":943,"children":944},{"style":92},[945],{"type":37,"value":946},"      STATUS=$(curl -s -o \u002Fdev\u002Fnull -w \"%{http_code}\" https:\u002F\u002Fheadless-origin.example.com\u002Fapi\u002Fhealth)\n",{"type":32,"tag":63,"props":948,"children":949},{"class":65,"line":26},[950],{"type":32,"tag":63,"props":951,"children":952},{"style":92},[953],{"type":37,"value":954},"      if [ $STATUS -ne 200 ]; then\n",{"type":32,"tag":63,"props":956,"children":957},{"class":65,"line":322},[958],{"type":32,"tag":63,"props":959,"children":960},{"style":92},[961],{"type":37,"value":962},"        echo \"Health check failed, rolling back\"\n",{"type":32,"tag":63,"props":964,"children":965},{"class":65,"line":331},[966],{"type":32,"tag":63,"props":967,"children":968},{"style":92},[969],{"type":37,"value":970},"        vercel rollback\n",{"type":32,"tag":63,"props":972,"children":973},{"class":65,"line":387},[974],{"type":32,"tag":63,"props":975,"children":976},{"style":92},[977],{"type":37,"value":978},"        exit 1\n",{"type":32,"tag":63,"props":980,"children":981},{"class":65,"line":395},[982],{"type":32,"tag":63,"props":983,"children":984},{"style":92},[985],{"type":37,"value":986},"      fi\n",{"type":32,"tag":63,"props":988,"children":989},{"class":65,"line":438},[990],{"type":32,"tag":63,"props":991,"children":992},{"style":92},[993],{"type":37,"value":994},"      sleep 5\n",{"type":32,"tag":63,"props":996,"children":997},{"class":65,"line":447},[998],{"type":32,"tag":63,"props":999,"children":1000},{"style":92},[1001],{"type":37,"value":1002},"    done\n",{"type":32,"tag":33,"props":1004,"children":1005},{},[1006],{"type":37,"value":1007},"L'endpoint di health check deve verificare i sistemi critici: connection pool del database, cache hit rate, ping del gateway di pagamento. Se non si raggiunge il 100% di successo entro 30 secondi, il deployment viene automaticamente ripristinato.",{"type":32,"tag":40,"props":1009,"children":1011},{"id":1010},"preservazione-seo-url-canonici-e-protezione-dei-dati-strutturati",[1012],{"type":37,"value":1013},"Preservazione SEO: URL Canonici e Protezione dei Dati Strutturati",{"type":32,"tag":33,"props":1015,"children":1016},{},[1017],{"type":37,"value":1018},"La paura maggiore nella migrazione headless è il calo del traffico organico. Secondo i dati di Google Merchant Center del 2025, il 68% dei siti e-commerce subisce una perdita di traffico organico superiore al 15% nei primi 90 giorni dopo la replatform. Le cause sono: modifica degli URL canonici, perdita dei dati strutturati, configurazione errata delle catene di redirect.",{"type":32,"tag":33,"props":1020,"children":1021},{},[1022],{"type":37,"value":1023},"Innanzitutto, mappare uno a uno la struttura degli URL tra il vecchio e il nuovo sistema. Se si passa da Shopify a Next.js:",{"type":32,"tag":1025,"props":1026,"children":1027},"table",{},[1028,1052],{"type":32,"tag":1029,"props":1030,"children":1031},"thead",{},[1032],{"type":32,"tag":1033,"props":1034,"children":1035},"tr",{},[1036,1042,1047],{"type":32,"tag":1037,"props":1038,"children":1039},"th",{},[1040],{"type":37,"value":1041},"Vecchio (Shopify Liquid)",{"type":32,"tag":1037,"props":1043,"children":1044},{},[1045],{"type":37,"value":1046},"Nuovo (Next.js)",{"type":32,"tag":1037,"props":1048,"children":1049},{},[1050],{"type":37,"value":1051},"Stato",{"type":32,"tag":1053,"props":1054,"children":1055},"tbody",{},[1056,1082,1108],{"type":32,"tag":1033,"props":1057,"children":1058},{},[1059,1069,1077],{"type":32,"tag":1060,"props":1061,"children":1062},"td",{},[1063],{"type":32,"tag":59,"props":1064,"children":1066},{"className":1065},[],[1067],{"type":37,"value":1068},"\u002Fproducts\u002Fwireless-headphones",{"type":32,"tag":1060,"props":1070,"children":1071},{},[1072],{"type":32,"tag":59,"props":1073,"children":1075},{"className":1074},[],[1076],{"type":37,"value":1068},{"type":32,"tag":1060,"props":1078,"children":1079},{},[1080],{"type":37,"value":1081},"✅ Slug identico",{"type":32,"tag":1033,"props":1083,"children":1084},{},[1085,1094,1103],{"type":32,"tag":1060,"props":1086,"children":1087},{},[1088],{"type":32,"tag":59,"props":1089,"children":1091},{"className":1090},[],[1092],{"type":37,"value":1093},"\u002Fcollections\u002Felectronics",{"type":32,"tag":1060,"props":1095,"children":1096},{},[1097],{"type":32,"tag":59,"props":1098,"children":1100},{"className":1099},[],[1101],{"type":37,"value":1102},"\u002Fcategories\u002Felectronics",{"type":32,"tag":1060,"props":1104,"children":1105},{},[1106],{"type":37,"value":1107},"❌ Percorso modificato — redirect 301 richiesto",{"type":32,"tag":1033,"props":1109,"children":1110},{},[1111,1120,1129],{"type":32,"tag":1060,"props":1112,"children":1113},{},[1114],{"type":32,"tag":59,"props":1115,"children":1117},{"className":1116},[],[1118],{"type":37,"value":1119},"\u002Fpages\u002Fabout",{"type":32,"tag":1060,"props":1121,"children":1122},{},[1123],{"type":32,"tag":59,"props":1124,"children":1126},{"className":1125},[],[1127],{"type":37,"value":1128},"\u002Fabout",{"type":32,"tag":1060,"props":1130,"children":1131},{},[1132],{"type":37,"value":1133},"⚠️ Percorso accorciato — aggiungi tag canonico",{"type":32,"tag":33,"props":1135,"children":1136},{},[1137],{"type":37,"value":1138},"Per i casi in cui il percorso cambia, configurare redirect 301 a livello Edge. Esempio con Cloudflare Workers:",{"type":32,"tag":52,"props":1140,"children":1142},{"className":54,"code":1141,"language":56,"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",[1143],{"type":32,"tag":59,"props":1144,"children":1145},{"__ignoreMap":16},[1146,1167,1189,1206,1213,1220,1251,1279,1304,1311,1323,1364,1371,1378,1402],{"type":32,"tag":63,"props":1147,"children":1148},{"class":65,"line":66},[1149,1154,1159,1163],{"type":32,"tag":63,"props":1150,"children":1151},{"style":109},[1152],{"type":37,"value":1153},"const",{"type":32,"tag":63,"props":1155,"children":1156},{"style":209},[1157],{"type":37,"value":1158}," REDIRECT_MAP",{"type":32,"tag":63,"props":1160,"children":1161},{"style":109},[1162],{"type":37,"value":217},{"type":32,"tag":63,"props":1164,"children":1165},{"style":86},[1166],{"type":37,"value":117},{"type":32,"tag":63,"props":1168,"children":1169},{"class":65,"line":76},[1170,1175,1179,1184],{"type":32,"tag":63,"props":1171,"children":1172},{"style":92},[1173],{"type":37,"value":1174},"  '\u002Fcollections\u002Felectronics'",{"type":32,"tag":63,"props":1176,"children":1177},{"style":86},[1178],{"type":37,"value":865},{"type":32,"tag":63,"props":1180,"children":1181},{"style":92},[1182],{"type":37,"value":1183},"'\u002Fcategories\u002Felectronics'",{"type":32,"tag":63,"props":1185,"children":1186},{"style":86},[1187],{"type":37,"value":1188},",\n",{"type":32,"tag":63,"props":1190,"children":1191},{"class":65,"line":120},[1192,1197,1201],{"type":32,"tag":63,"props":1193,"children":1194},{"style":92},[1195],{"type":37,"value":1196},"  '\u002Fpages\u002Fabout'",{"type":32,"tag":63,"props":1198,"children":1199},{"style":86},[1200],{"type":37,"value":865},{"type":32,"tag":63,"props":1202,"children":1203},{"style":92},[1204],{"type":37,"value":1205},"'\u002Fabout'\n",{"type":32,"tag":63,"props":1207,"children":1208},{"class":65,"line":148},[1209],{"type":32,"tag":63,"props":1210,"children":1211},{"style":86},[1212],{"type":37,"value":551},{"type":32,"tag":63,"props":1214,"children":1215},{"class":65,"line":157},[1216],{"type":32,"tag":63,"props":1217,"children":1218},{"emptyLinePlaceholder":161},[1219],{"type":37,"value":164},{"type":32,"tag":63,"props":1221,"children":1222},{"class":65,"line":167},[1223,1227,1231,1235,1239,1243,1247],{"type":32,"tag":63,"props":1224,"children":1225},{"style":80},[1226],{"type":37,"value":83},{"type":32,"tag":63,"props":1228,"children":1229},{"style":86},[1230],{"type":37,"value":89},{"type":32,"tag":63,"props":1232,"children":1233},{"style":92},[1234],{"type":37,"value":95},{"type":32,"tag":63,"props":1236,"children":1237},{"style":86},[1238],{"type":37,"value":100},{"type":32,"tag":63,"props":1240,"children":1241},{"style":103},[1242],{"type":37,"value":106},{"type":32,"tag":63,"props":1244,"children":1245},{"style":109},[1246],{"type":37,"value":112},{"type":32,"tag":63,"props":1248,"children":1249},{"style":86},[1250],{"type":37,"value":117},{"type":32,"tag":63,"props":1252,"children":1253},{"class":65,"line":200},[1254,1258,1262,1266,1270,1274],{"type":32,"tag":63,"props":1255,"children":1256},{"style":109},[1257],{"type":37,"value":206},{"type":32,"tag":63,"props":1259,"children":1260},{"style":209},[1261],{"type":37,"value":212},{"type":32,"tag":63,"props":1263,"children":1264},{"style":109},[1265],{"type":37,"value":217},{"type":32,"tag":63,"props":1267,"children":1268},{"style":109},[1269],{"type":37,"value":222},{"type":32,"tag":63,"props":1271,"children":1272},{"style":80},[1273],{"type":37,"value":227},{"type":32,"tag":63,"props":1275,"children":1276},{"style":86},[1277],{"type":37,"value":1278},"(event.request.url)\n",{"type":32,"tag":63,"props":1280,"children":1281},{"class":65,"line":235},[1282,1286,1291,1295,1299],{"type":32,"tag":63,"props":1283,"children":1284},{"style":109},[1285],{"type":37,"value":206},{"type":32,"tag":63,"props":1287,"children":1288},{"style":209},[1289],{"type":37,"value":1290}," newPath",{"type":32,"tag":63,"props":1292,"children":1293},{"style":109},[1294],{"type":37,"value":217},{"type":32,"tag":63,"props":1296,"children":1297},{"style":209},[1298],{"type":37,"value":1158},{"type":32,"tag":63,"props":1300,"children":1301},{"style":86},[1302],{"type":37,"value":1303},"[url.pathname]\n",{"type":32,"tag":63,"props":1305,"children":1306},{"class":65,"line":26},[1307],{"type":32,"tag":63,"props":1308,"children":1309},{"style":86},[1310],{"type":37,"value":328},{"type":32,"tag":63,"props":1312,"children":1313},{"class":65,"line":322},[1314,1318],{"type":32,"tag":63,"props":1315,"children":1316},{"style":109},[1317],{"type":37,"value":401},{"type":32,"tag":63,"props":1319,"children":1320},{"style":86},[1321],{"type":37,"value":1322}," (newPath) {\n",{"type":32,"tag":63,"props":1324,"children":1325},{"class":65,"line":331},[1326,1330,1335,1340,1345,1349,1354,1359],{"type":32,"tag":63,"props":1327,"children":1328},{"style":109},[1329],{"type":37,"value":453},{"type":32,"tag":63,"props":1331,"children":1332},{"style":86},[1333],{"type":37,"value":1334}," Response.",{"type":32,"tag":63,"props":1336,"children":1337},{"style":80},[1338],{"type":37,"value":1339},"redirect",{"type":32,"tag":63,"props":1341,"children":1342},{"style":86},[1343],{"type":37,"value":1344},"(url.origin ",{"type":32,"tag":63,"props":1346,"children":1347},{"style":109},[1348],{"type":37,"value":721},{"type":32,"tag":63,"props":1350,"children":1351},{"style":86},[1352],{"type":37,"value":1353}," newPath, ",{"type":32,"tag":63,"props":1355,"children":1356},{"style":209},[1357],{"type":37,"value":1358},"301",{"type":32,"tag":63,"props":1360,"children":1361},{"style":86},[1362],{"type":37,"value":1363},")\n",{"type":32,"tag":63,"props":1365,"children":1366},{"class":65,"line":387},[1367],{"type":32,"tag":63,"props":1368,"children":1369},{"style":86},[1370],{"type":37,"value":542},{"type":32,"tag":63,"props":1372,"children":1373},{"class":65,"line":395},[1374],{"type":32,"tag":63,"props":1375,"children":1376},{"style":86},[1377],{"type":37,"value":328},{"type":32,"tag":63,"props":1379,"children":1380},{"class":65,"line":438},[1381,1385,1389,1393,1398],{"type":32,"tag":63,"props":1382,"children":1383},{"style":86},[1384],{"type":37,"value":126},{"type":32,"tag":63,"props":1386,"children":1387},{"style":80},[1388],{"type":37,"value":131},{"type":32,"tag":63,"props":1390,"children":1391},{"style":86},[1392],{"type":37,"value":89},{"type":32,"tag":63,"props":1394,"children":1395},{"style":80},[1396],{"type":37,"value":1397},"fetch",{"type":32,"tag":63,"props":1399,"children":1400},{"style":86},[1401],{"type":37,"value":145},{"type":32,"tag":63,"props":1403,"children":1404},{"class":65,"line":447},[1405],{"type":32,"tag":63,"props":1406,"children":1407},{"style":86},[1408],{"type":37,"value":154},{"type":32,"tag":33,"props":1410,"children":1411},{},[1412,1414,1420],{"type":37,"value":1413},"Verificare i dati strutturati: gli schema Product, BreadcrumbList e Organization presenti nel vecchio sistema devono mantenere lo stesso formato nel nuovo. In Next.js, utilizzare ",{"type":32,"tag":59,"props":1415,"children":1417},{"className":1416},[],[1418],{"type":37,"value":1419},"\u003Cscript type=\"application\u002Fld+json\">",{"type":37,"value":1421}," manuale al posto di next-seo — la garanzia di rendering è più alta:",{"type":32,"tag":52,"props":1423,"children":1427},{"className":1424,"code":1425,"language":1426,"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\": \"EUR\",\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* Renderizzazione del prodotto *\u002F}\n    \u003C\u002F>\n  )\n}\n","jsx",[1428],{"type":32,"tag":59,"props":1429,"children":1430},{"__ignoreMap":16},[1431,1439,1476,1496,1517,1538,1551,1564,1577,1598,1611,1632,1674,1682,1689,1696,1708,1716,1729,1746,1783,1791,1808,1816,1824],{"type":32,"tag":63,"props":1432,"children":1433},{"class":65,"line":66},[1434],{"type":32,"tag":63,"props":1435,"children":1436},{"style":70},[1437],{"type":37,"value":1438},"\u002F\u002F app\u002Fproducts\u002F[slug]\u002Fpage.tsx\n",{"type":32,"tag":63,"props":1440,"children":1441},{"class":65,"line":76},[1442,1447,1452,1456,1461,1466,1471],{"type":32,"tag":63,"props":1443,"children":1444},{"style":109},[1445],{"type":37,"value":1446},"export",{"type":32,"tag":63,"props":1448,"children":1449},{"style":109},[1450],{"type":37,"value":1451}," default",{"type":32,"tag":63,"props":1453,"children":1454},{"style":109},[1455],{"type":37,"value":178},{"type":32,"tag":63,"props":1457,"children":1458},{"style":80},[1459],{"type":37,"value":1460}," ProductPage",{"type":32,"tag":63,"props":1462,"children":1463},{"style":86},[1464],{"type":37,"value":1465},"({ ",{"type":32,"tag":63,"props":1467,"children":1468},{"style":103},[1469],{"type":37,"value":1470},"product",{"type":32,"tag":63,"props":1472,"children":1473},{"style":86},[1474],{"type":37,"value":1475}," }) {\n",{"type":32,"tag":63,"props":1477,"children":1478},{"class":65,"line":120},[1479,1483,1488,1492],{"type":32,"tag":63,"props":1480,"children":1481},{"style":109},[1482],{"type":37,"value":206},{"type":32,"tag":63,"props":1484,"children":1485},{"style":209},[1486],{"type":37,"value":1487}," structuredData",{"type":32,"tag":63,"props":1489,"children":1490},{"style":109},[1491],{"type":37,"value":217},{"type":32,"tag":63,"props":1493,"children":1494},{"style":86},[1495],{"type":37,"value":117},{"type":32,"tag":63,"props":1497,"children":1498},{"class":65,"line":148},[1499,1504,1508,1513],{"type":32,"tag":63,"props":1500,"children":1501},{"style":92},[1502],{"type":37,"value":1503},"    \"@context\"",{"type":32,"tag":63,"props":1505,"children":1506},{"style":86},[1507],{"type":37,"value":865},{"type":32,"tag":63,"props":1509,"children":1510},{"style":92},[1511],{"type":37,"value":1512},"\"https:\u002F\u002Fschema.org\"",{"type":32,"tag":63,"props":1514,"children":1515},{"style":86},[1516],{"type":37,"value":1188},{"type":32,"tag":63,"props":1518,"children":1519},{"class":65,"line":157},[1520,1525,1529,1534],{"type":32,"tag":63,"props":1521,"children":1522},{"style":92},[1523],{"type":37,"value":1524},"    \"@type\"",{"type":32,"tag":63,"props":1526,"children":1527},{"style":86},[1528],{"type":37,"value":865},{"type":32,"tag":63,"props":1530,"children":1531},{"style":92},[1532],{"type":37,"value":1533},"\"Product\"",{"type":32,"tag":63,"props":1535,"children":1536},{"style":86},[1537],{"type":37,"value":1188},{"type":32,"tag":63,"props":1539,"children":1540},{"class":65,"line":167},[1541,1546],{"type":32,"tag":63,"props":1542,"children":1543},{"style":92},[1544],{"type":37,"value":1545},"    \"name\"",{"type":32,"tag":63,"props":1547,"children":1548},{"style":86},[1549],{"type":37,"value":1550},": product.title,\n",{"type":32,"tag":63,"props":1552,"children":1553},{"class":65,"line":200},[1554,1559],{"type":32,"tag":63,"props":1555,"children":1556},{"style":92},[1557],{"type":37,"value":1558},"    \"sku\"",{"type":32,"tag":63,"props":1560,"children":1561},{"style":86},[1562],{"type":37,"value":1563},": product.sku,\n",{"type":32,"tag":63,"props":1565,"children":1566},{"class":65,"line":235},[1567,1572],{"type":32,"tag":63,"props":1568,"children":1569},{"style":92},[1570],{"type":37,"value":1571},"    \"offers\"",{"type":32,"tag":63,"props":1573,"children":1574},{"style":86},[1575],{"type":37,"value":1576},": {\n",{"type":32,"tag":63,"props":1578,"children":1579},{"class":65,"line":26},[1580,1585,1589,1594],{"type":32,"tag":63,"props":1581,"children":1582},{"style":92},[1583],{"type":37,"value":1584},"      \"@type\"",{"type":32,"tag":63,"props":1586,"children":1587},{"style":86},[1588],{"type":37,"value":865},{"type":32,"tag":63,"props":1590,"children":1591},{"style":92},[1592],{"type":37,"value":1593},"\"Offer\"",{"type":32,"tag":63,"props":1595,"children":1596},{"style":86},[1597],{"type":37,"value":1188},{"type":32,"tag":63,"props":1599,"children":1600},{"class":65,"line":322},[1601,1606],{"type":32,"tag":63,"props":1602,"children":1603},{"style":92},[1604],{"type":37,"value":1605},"      \"price\"",{"type":32,"tag":63,"props":1607,"children":1608},{"style":86},[1609],{"type":37,"value":1610},": product.price,\n",{"type":32,"tag":63,"props":1612,"children":1613},{"class":65,"line":331},[1614,1619,1623,1628],{"type":32,"tag":63,"props":1615,"children":1616},{"style":92},[1617],{"type":37,"value":1618},"      \"priceCurrency\"",{"type":32,"tag":63,"props":1620,"children":1621},{"style":86},[1622],{"type":37,"value":865},{"type":32,"tag":63,"props":1624,"children":1625},{"style":92},[1626],{"type":37,"value":1627},"\"EUR\"",{"type":32,"tag":63,"props":1629,"children":1630},{"style":86},[1631],{"type":37,"value":1188},{"type":32,"tag":63,"props":1633,"children":1634},{"class":65,"line":387},[1635,1640,1645,1650,1654,1659,1664,1669],{"type":32,"tag":63,"props":1636,"children":1637},{"style":92},[1638],{"type":37,"value":1639},"      \"availability\"",{"type":32,"tag":63,"props":1641,"children":1642},{"style":86},[1643],{"type":37,"value":1644},": product.stock ",{"type":32,"tag":63,"props":1646,"children":1647},{"style":109},[1648],{"type":37,"value":1649},">",{"type":32,"tag":63,"props":1651,"children":1652},{"style":209},[1653],{"type":37,"value":642},{"type":32,"tag":63,"props":1655,"children":1656},{"style":109},[1657],{"type":37,"value":1658}," ?",{"type":32,"tag":63,"props":1660,"children":1661},{"style":92},[1662],{"type":37,"value":1663}," \"InStock\"",{"type":32,"tag":63,"props":1665,"children":1666},{"style":109},[1667],{"type":37,"value":1668}," :",{"type":32,"tag":63,"props":1670,"children":1671},{"style":92},[1672],{"type":37,"value":1673}," \"OutOfStock\"\n",{"type":32,"tag":63,"props":1675,"children":1676},{"class":65,"line":395},[1677],{"type":32,"tag":63,"props":1678,"children":1679},{"style":86},[1680],{"type":37,"value":1681},"    }\n",{"type":32,"tag":63,"props":1683,"children":1684},{"class":65,"line":438},[1685],{"type":32,"tag":63,"props":1686,"children":1687},{"style":86},[1688],{"type":37,"value":542},{"type":32,"tag":63,"props":1690,"children":1691},{"class":65,"line":447},[1692],{"type":32,"tag":63,"props":1693,"children":1694},{"style":86},[1695],{"type":37,"value":328},{"type":32,"tag":63,"props":1697,"children":1698},{"class":65,"line":480},[1699,1703],{"type":32,"tag":63,"props":1700,"children":1701},{"style":109},[1702],{"type":37,"value":769},{"type":32,"tag":63,"props":1704,"children":1705},{"style":86},[1706],{"type":37,"value":1707}," (\n",{"type":32,"tag":63,"props":1709,"children":1710},{"class":65,"line":498},[1711],{"type":32,"tag":63,"props":1712,"children":1713},{"style":86},[1714],{"type":37,"value":1715},"    \u003C>\n",{"type":32,"tag":63,"props":1717,"children":1718},{"class":65,"line":507},[1719,1724],{"type":32,"tag":63,"props":1720,"children":1721},{"style":86},[1722],{"type":37,"value":1723},"      \u003C",{"type":32,"tag":63,"props":1725,"children":1726},{"style":857},[1727],{"type":37,"value":1728},"script\n",{"type":32,"tag":63,"props":1730,"children":1731},{"class":65,"line":536},[1732,1737,1741],{"type":32,"tag":63,"props":1733,"children":1734},{"style":80},[1735],{"type":37,"value":1736},"        type",{"type":32,"tag":63,"props":1738,"children":1739},{"style":109},[1740],{"type":37,"value":605},{"type":32,"tag":63,"props":1742,"children":1743},{"style":92},[1744],{"type":37,"value":1745},"\"application\u002Fld+json\"\n",{"type":32,"tag":63,"props":1747,"children":1748},{"class":65,"line":545},[1749,1754,1758,1763,1768,1773,1778],{"type":32,"tag":63,"props":1750,"children":1751},{"style":80},[1752],{"type":37,"value":1753},"        dangerouslySetInnerHTML",{"type":32,"tag":63,"props":1755,"children":1756},{"style":109},[1757],{"type":37,"value":605},{"type":32,"tag":63,"props":1759,"children":1760},{"style":86},[1761],{"type":37,"value":1762},"{{ __html: ",{"type":32,"tag":63,"props":1764,"children":1765},{"style":209},[1766],{"type":37,"value":1767},"JSON",{"type":32,"tag":63,"props":1769,"children":1770},{"style":86},[1771],{"type":37,"value":1772},".",{"type":32,"tag":63,"props":1774,"children":1775},{"style":80},[1776],{"type":37,"value":1777},"stringify",{"type":32,"tag":63,"props":1779,"children":1780},{"style":86},[1781],{"type":37,"value":1782},"(structuredData) }}\n",{"type":32,"tag":63,"props":1784,"children":1785},{"class":65,"line":554},[1786],{"type":32,"tag":63,"props":1787,"children":1788},{"style":86},[1789],{"type":37,"value":1790},"      \u002F>\n",{"type":32,"tag":63,"props":1792,"children":1793},{"class":65,"line":562},[1794,1799,1804],{"type":32,"tag":63,"props":1795,"children":1796},{"style":86},[1797],{"type":37,"value":1798},"      {",{"type":32,"tag":63,"props":1800,"children":1801},{"style":70},[1802],{"type":37,"value":1803},"\u002F* Renderizzazione del prodotto *\u002F",{"type":32,"tag":63,"props":1805,"children":1806},{"style":86},[1807],{"type":37,"value":551},{"type":32,"tag":63,"props":1809,"children":1810},{"class":65,"line":589},[1811],{"type":32,"tag":63,"props":1812,"children":1813},{"style":86},[1814],{"type":37,"value":1815},"    \u003C\u002F>\n",{"type":32,"tag":63,"props":1817,"children":1818},{"class":65,"line":613},[1819],{"type":32,"tag":63,"props":1820,"children":1821},{"style":86},[1822],{"type":37,"value":1823},"  )\n",{"type":32,"tag":63,"props":1825,"children":1826},{"class":65,"line":678},[1827],{"type":32,"tag":63,"props":1828,"children":1829},{"style":86},[1830],{"type":37,"value":551},{"type":32,"tag":33,"props":1832,"children":1833},{},[1834],{"type":37,"value":1835},"Utilizzare lo strumento \"URL Inspection\" in Google Search Console per verificare lo stato di indicizzazione delle nuove pagine. Nei primi 30 giorni dopo la migrazione, controllare settimanalmente il rapporto \"Coverage\": se il numero di errori \"Indexed, not submitted in sitemap\" nel nuovo sistema supera 50, significa che la generazione della sitemap non funziona.",{"type":32,"tag":819,"props":1837,"children":1839},{"id":1838},"minimizzazione-delle-catene-di-redirect",[1840],{"type":37,"value":1841},"Minimizzazione delle Catene di Redirect",{"type":32,"tag":33,"props":1843,"children":1844},{},[1845,1847,1853,1855,1861,1863,1872],{"type":37,"value":1846},"Pulire le catene di redirect del vecchio sistema. Ad esempio, se in Shopify esiste un redirect ",{"type":32,"tag":59,"props":1848,"children":1850},{"className":1849},[],[1851],{"type":37,"value":1852},"\u002Fproducts\u002Fold-name",{"type":37,"value":1854}," → ",{"type":32,"tag":59,"props":1856,"children":1858},{"className":1857},[],[1859],{"type":37,"value":1860},"\u002Fproducts\u002Fnew-name",{"type":37,"value":1862},", nel sistema headless utilizzare direttamente l'URL finale. Più di due livelli di redirect (A → B → C) consumano il crawl budget di Google e riducono l'efficienza del trasferimento di PageRank. Nei progetti headless di Roibase, il processo di audit dei redirect garantisce in media una riduzione del 40% delle catene. Per ulteriori dettagli, consultare ",{"type":32,"tag":1864,"props":1865,"children":1869},"a",{"href":1866,"rel":1867},"https:\u002F\u002Fwww.roibase.com.tr\u002Fit\u002Fheadless",[1868],"nofollow",[1870],{"type":37,"value":1871},"Headless Commerce",{"type":37,"value":1772},{"type":32,"tag":40,"props":1874,"children":1876},{"id":1875},"analisi-dellabbandono-del-carrello-monitoraggio-dellimbuto-di-conversione",[1877],{"type":37,"value":1878},"Analisi dell'Abbandono del Carrello: Monitoraggio dell'Imbuto di Conversione",{"type":32,"tag":33,"props":1880,"children":1881},{},[1882],{"type":37,"value":1883},"La metrica più delicata durante la migrazione headless è il tasso di successo add-to-cart (ATC). Se nel vecchio sistema il tasso di successo è del 99,5% e nel nuovo scende al 98%, significa 1.500 carrelli persi al giorno (100.000 visitatori × 3% intenzione ATC × 1,5% calo).",{"type":32,"tag":33,"props":1885,"children":1886},{},[1887],{"type":37,"value":1888},"È obbligatorio registrare l'evento ATC sia lato client che lato server. Un tag GTM lato client non può catturare errori di rete; un log lato server è un record definitivo:",{"type":32,"tag":52,"props":1890,"children":1892},{"className":54,"code":1891,"language":56,"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 Event logging lato server\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",[1893],{"type":32,"tag":59,"props":1894,"children":1895},{"__ignoreMap":16},[1896,1904,1927,1948,1955,1998,2052,2082,2089,2101,2132,2170,2178,2186,2204,2221,2229,2237,2250,2274,2282,2289,2320,2337,2372,2379,2394,2410,2417,2424,2433,2442,2466,2474,2482,2522,2530],{"type":32,"tag":63,"props":1897,"children":1898},{"class":65,"line":66},[1899],{"type":32,"tag":63,"props":1900,"children":1901},{"style":70},[1902],{"type":37,"value":1903},"\u002F\u002F app\u002Fapi\u002Fcart\u002Fadd\u002Froute.ts (Next.js App Router)\n",{"type":32,"tag":63,"props":1905,"children":1906},{"class":65,"line":76},[1907,1912,1917,1922],{"type":32,"tag":63,"props":1908,"children":1909},{"style":109},[1910],{"type":37,"value":1911},"import",{"type":32,"tag":63,"props":1913,"children":1914},{"style":86},[1915],{"type":37,"value":1916}," { NextResponse } ",{"type":32,"tag":63,"props":1918,"children":1919},{"style":109},[1920],{"type":37,"value":1921},"from",{"type":32,"tag":63,"props":1923,"children":1924},{"style":92},[1925],{"type":37,"value":1926}," 'next\u002Fserver'\n",{"type":32,"tag":63,"props":1928,"children":1929},{"class":65,"line":120},[1930,1934,1939,1943],{"type":32,"tag":63,"props":1931,"children":1932},{"style":109},[1933],{"type":37,"value":1911},{"type":32,"tag":63,"props":1935,"children":1936},{"style":86},[1937],{"type":37,"value":1938}," { logEvent } ",{"type":32,"tag":63,"props":1940,"children":1941},{"style":109},[1942],{"type":37,"value":1921},{"type":32,"tag":63,"props":1944,"children":1945},{"style":92},[1946],{"type":37,"value":1947}," '@\u002Flib\u002Fanalytics'\n",{"type":32,"tag":63,"props":1949,"children":1950},{"class":65,"line":148},[1951],{"type":32,"tag":63,"props":1952,"children":1953},{"emptyLinePlaceholder":161},[1954],{"type":37,"value":164},{"type":32,"tag":63,"props":1956,"children":1957},{"class":65,"line":157},[1958,1962,1967,1971,1976,1980,1984,1989,1994],{"type":32,"tag":63,"props":1959,"children":1960},{"style":109},[1961],{"type":37,"value":1446},{"type":32,"tag":63,"props":1963,"children":1964},{"style":109},[1965],{"type":37,"value":1966}," async",{"type":32,"tag":63,"props":1968,"children":1969},{"style":109},[1970],{"type":37,"value":178},{"type":32,"tag":63,"props":1972,"children":1973},{"style":80},[1974],{"type":37,"value":1975}," POST",{"type":32,"tag":63,"props":1977,"children":1978},{"style":86},[1979],{"type":37,"value":89},{"type":32,"tag":63,"props":1981,"children":1982},{"style":103},[1983],{"type":37,"value":192},{"type":32,"tag":63,"props":1985,"children":1986},{"style":109},[1987],{"type":37,"value":1988},":",{"type":32,"tag":63,"props":1990,"children":1991},{"style":80},[1992],{"type":37,"value":1993}," Request",{"type":32,"tag":63,"props":1995,"children":1996},{"style":86},[1997],{"type":37,"value":197},{"type":32,"tag":63,"props":1999,"children":2000},{"class":65,"line":167},[2001,2005,2010,2015,2019,2024,2029,2033,2038,2043,2048],{"type":32,"tag":63,"props":2002,"children":2003},{"style":109},[2004],{"type":37,"value":206},{"type":32,"tag":63,"props":2006,"children":2007},{"style":86},[2008],{"type":37,"value":2009}," { ",{"type":32,"tag":63,"props":2011,"children":2012},{"style":209},[2013],{"type":37,"value":2014},"productId",{"type":32,"tag":63,"props":2016,"children":2017},{"style":86},[2018],{"type":37,"value":100},{"type":32,"tag":63,"props":2020,"children":2021},{"style":209},[2022],{"type":37,"value":2023},"quantity",{"type":32,"tag":63,"props":2025,"children":2026},{"style":86},[2027],{"type":37,"value":2028}," } ",{"type":32,"tag":63,"props":2030,"children":2031},{"style":109},[2032],{"type":37,"value":605},{"type":32,"tag":63,"props":2034,"children":2035},{"style":109},[2036],{"type":37,"value":2037}," await",{"type":32,"tag":63,"props":2039,"children":2040},{"style":86},[2041],{"type":37,"value":2042}," request.",{"type":32,"tag":63,"props":2044,"children":2045},{"style":80},[2046],{"type":37,"value":2047},"json",{"type":32,"tag":63,"props":2049,"children":2050},{"style":86},[2051],{"type":37,"value":293},{"type":32,"tag":63,"props":2053,"children":2054},{"class":65,"line":200},[2055,2059,2064,2068,2073,2078],{"type":32,"tag":63,"props":2056,"children":2057},{"style":109},[2058],{"type":37,"value":206},{"type":32,"tag":63,"props":2060,"children":2061},{"style":209},[2062],{"type":37,"value":2063}," startTime",{"type":32,"tag":63,"props":2065,"children":2066},{"style":109},[2067],{"type":37,"value":217},{"type":32,"tag":63,"props":2069,"children":2070},{"style":86},[2071],{"type":37,"value":2072}," Date.",{"type":32,"tag":63,"props":2074,"children":2075},{"style":80},[2076],{"type":37,"value":2077},"now",{"type":32,"tag":63,"props":2079,"children":2080},{"style":86},[2081],{"type":37,"value":293},{"type":32,"tag":63,"props":2083,"children":2084},{"class":65,"line":235},[2085],{"type":32,"tag":63,"props":2086,"children":2087},{"style":86},[2088],{"type":37,"value":328},{"type":32,"tag":63,"props":2090,"children":2091},{"class":65,"line":26},[2092,2097],{"type":32,"tag":63,"props":2093,"children":2094},{"style":109},[2095],{"type":37,"value":2096},"  try",{"type":32,"tag":63,"props":2098,"children":2099},{"style":86},[2100],{"type":37,"value":117},{"type":32,"tag":63,"props":2102,"children":2103},{"class":65,"line":322},[2104,2109,2114,2118,2122,2127],{"type":32,"tag":63,"props":2105,"children":2106},{"style":109},[2107],{"type":37,"value":2108},"    const",{"type":32,"tag":63,"props":2110,"children":2111},{"style":209},[2112],{"type":37,"value":2113}," cart",{"type":32,"tag":63,"props":2115,"children":2116},{"style":109},[2117],{"type":37,"value":217},{"type":32,"tag":63,"props":2119,"children":2120},{"style":109},[2121],{"type":37,"value":2037},{"type":32,"tag":63,"props":2123,"children":2124},{"style":80},[2125],{"type":37,"value":2126}," addToCart",{"type":32,"tag":63,"props":2128,"children":2129},{"style":86},[2130],{"type":37,"value":2131},"(productId, quantity)\n",{"type":32,"tag":63,"props":2133,"children":2134},{"class":65,"line":331},[2135,2139,2144,2148,2152,2156,2161,2165],{"type":32,"tag":63,"props":2136,"children":2137},{"style":109},[2138],{"type":37,"value":2108},{"type":32,"tag":63,"props":2140,"children":2141},{"style":209},[2142],{"type":37,"value":2143}," duration",{"type":32,"tag":63,"props":2145,"children":2146},{"style":109},[2147],{"type":37,"value":217},{"type":32,"tag":63,"props":2149,"children":2150},{"style":86},[2151],{"type":37,"value":2072},{"type":32,"tag":63,"props":2153,"children":2154},{"style":80},[2155],{"type":37,"value":2077},{"type":32,"tag":63,"props":2157,"children":2158},{"style":86},[2159],{"type":37,"value":2160},"() ",{"type":32,"tag":63,"props":2162,"children":2163},{"style":109},[2164],{"type":37,"value":711},{"type":32,"tag":63,"props":2166,"children":2167},{"style":86},[2168],{"type":37,"value":2169}," startTime\n",{"type":32,"tag":63,"props":2171,"children":2172},{"class":65,"line":387},[2173],{"type":32,"tag":63,"props":2174,"children":2175},{"style":86},[2176],{"type":37,"value":2177},"    \n",{"type":32,"tag":63,"props":2179,"children":2180},{"class":65,"line":395},[2181],{"type":32,"tag":63,"props":2182,"children":2183},{"style":70},[2184],{"type":37,"value":2185},"    \u002F\u002F Event logging lato server\n",{"type":32,"tag":63,"props":2187,"children":2188},{"class":65,"line":438},[2189,2194,2199],{"type":32,"tag":63,"props":2190,"children":2191},{"style":109},[2192],{"type":37,"value":2193},"    await",{"type":32,"tag":63,"props":2195,"children":2196},{"style":80},[2197],{"type":37,"value":2198}," logEvent",{"type":32,"tag":63,"props":2200,"children":2201},{"style":86},[2202],{"type":37,"value":2203},"({\n",{"type":32,"tag":63,"props":2205,"children":2206},{"class":65,"line":447},[2207,2212,2217],{"type":32,"tag":63,"props":2208,"children":2209},{"style":86},[2210],{"type":37,"value":2211},"      event: ",{"type":32,"tag":63,"props":2213,"children":2214},{"style":92},[2215],{"type":37,"value":2216},"'add_to_cart_success'",{"type":32,"tag":63,"props":2218,"children":2219},{"style":86},[2220],{"type":37,"value":1188},{"type":32,"tag":63,"props":2222,"children":2223},{"class":65,"line":480},[2224],{"type":32,"tag":63,"props":2225,"children":2226},{"style":86},[2227],{"type":37,"value":2228},"      productId,\n",{"type":32,"tag":63,"props":2230,"children":2231},{"class":65,"line":498},[2232],{"type":32,"tag":63,"props":2233,"children":2234},{"style":86},[2235],{"type":37,"value":2236},"      quantity,\n",{"type":32,"tag":63,"props":2238,"children":2239},{"class":65,"line":507},[2240,2245],{"type":32,"tag":63,"props":2241,"children":2242},{"style":86},[2243],{"type":37,"value":2244},"      duration, ",{"type":32,"tag":63,"props":2246,"children":2247},{"style":70},[2248],{"type":37,"value":2249},"\u002F\u002F ms\n",{"type":32,"tag":63,"props":2251,"children":2252},{"class":65,"line":536},[2253,2258,2262,2266,2270],{"type":32,"tag":63,"props":2254,"children":2255},{"style":86},[2256],{"type":37,"value":2257},"      userId: request.headers.",{"type":32,"tag":63,"props":2259,"children":2260},{"style":80},[2261],{"type":37,"value":259},{"type":32,"tag":63,"props":2263,"children":2264},{"style":86},[2265],{"type":37,"value":89},{"type":32,"tag":63,"props":2267,"children":2268},{"style":92},[2269],{"type":37,"value":268},{"type":32,"tag":63,"props":2271,"children":2272},{"style":86},[2273],{"type":37,"value":1363},{"type":32,"tag":63,"props":2275,"children":2276},{"class":65,"line":545},[2277],{"type":32,"tag":63,"props":2278,"children":2279},{"style":86},[2280],{"type":37,"value":2281},"    })\n",{"type":32,"tag":63,"props":2283,"children":2284},{"class":65,"line":554},[2285],{"type":32,"tag":63,"props":2286,"children":2287},{"style":86},[2288],{"type":37,"value":2177},{"type":32,"tag":63,"props":2290,"children":2291},{"class":65,"line":562},[2292,2296,2301,2305,2310,2315],{"type":32,"tag":63,"props":2293,"children":2294},{"style":109},[2295],{"type":37,"value":453},{"type":32,"tag":63,"props":2297,"children":2298},{"style":86},[2299],{"type":37,"value":2300}," NextResponse.",{"type":32,"tag":63,"props":2302,"children":2303},{"style":80},[2304],{"type":37,"value":2047},{"type":32,"tag":63,"props":2306,"children":2307},{"style":86},[2308],{"type":37,"value":2309},"({ cart }, { status: ",{"type":32,"tag":63,"props":2311,"children":2312},{"style":209},[2313],{"type":37,"value":2314},"200",{"type":32,"tag":63,"props":2316,"children":2317},{"style":86},[2318],{"type":37,"value":2319}," })\n",{"type":32,"tag":63,"props":2321,"children":2322},{"class":65,"line":589},[2323,2327,2332],{"type":32,"tag":63,"props":2324,"children":2325},{"style":86},[2326],{"type":37,"value":486},{"type":32,"tag":63,"props":2328,"children":2329},{"style":109},[2330],{"type":37,"value":2331},"catch",{"type":32,"tag":63,"props":2333,"children":2334},{"style":86},[2335],{"type":37,"value":2336}," (error) {\n",{"type":32,"tag":63,"props":2338,"children":2339},{"class":65,"line":613},[2340,2344,2348,2352,2356,2360,2364,2368],{"type":32,"tag":63,"props":2341,"children":2342},{"style":109},[2343],{"type":37,"value":2108},{"type":32,"tag":63,"props":2345,"children":2346},{"style":209},[2347],{"type":37,"value":2143},{"type":32,"tag":63,"props":2349,"children":2350},{"style":109},[2351],{"type":37,"value":217},{"type":32,"tag":63,"props":2353,"children":2354},{"style":86},[2355],{"type":37,"value":2072},{"type":32,"tag":63,"props":2357,"children":2358},{"style":80},[2359],{"type":37,"value":2077},{"type":32,"tag":63,"props":2361,"children":2362},{"style":86},[2363],{"type":37,"value":2160},{"type":32,"tag":63,"props":2365,"children":2366},{"style":109},[2367],{"type":37,"value":711},{"type":32,"tag":63,"props":2369,"children":2370},{"style":86},[2371],{"type":37,"value":2169},{"type":32,"tag":63,"props":2373,"children":2374},{"class":65,"line":678},[2375],{"type":32,"tag":63,"props":2376,"children":2377},{"style":86},[2378],{"type":37,"value":2177},{"type":32,"tag":63,"props":2380,"children":2381},{"class":65,"line":738},[2382,2386,2390],{"type":32,"tag":63,"props":2383,"children":2384},{"style":109},[2385],{"type":37,"value":2193},{"type":32,"tag":63,"props":2387,"children":2388},{"style":80},[2389],{"type":37,"value":2198},{"type":32,"tag":63,"props":2391,"children":2392},{"style":86},[2393],{"type":37,"value":2203},{"type":32,"tag":63,"props":2395,"children":2396},{"class":65,"line":755},[2397,2401,2406],{"type":32,"tag":63,"props":2398,"children":2399},{"style":86},[2400],{"type":37,"value":2211},{"type":32,"tag":63,"props":2402,"children":2403},{"style":92},[2404],{"type":37,"value":2405},"'add_to_cart_failure'",{"type":32,"tag":63,"props":2407,"children":2408},{"style":86},[2409],{"type":37,"value":1188},{"type":32,"tag":63,"props":2411,"children":2412},{"class":65,"line":763},[2413],{"type":32,"tag":63,"props":2414,"children":2415},{"style":86},[2416],{"type":37,"value":2228},{"type":32,"tag":63,"props":2418,"children":2419},{"class":65,"line":786},[2420],{"type":32,"tag":63,"props":2421,"children":2422},{"style":86},[2423],{"type":37,"value":2236},{"type":32,"tag":63,"props":2425,"children":2427},{"class":65,"line":2426},30,[2428],{"type":32,"tag":63,"props":2429,"children":2430},{"style":86},[2431],{"type":37,"value":2432},"      duration,\n",{"type":32,"tag":63,"props":2434,"children":2436},{"class":65,"line":2435},31,[2437],{"type":32,"tag":63,"props":2438,"children":2439},{"style":86},[2440],{"type":37,"value":2441},"      error: error.message,\n",{"type":32,"tag":63,"props":2443,"children":2445},{"class":65,"line":2444},32,[2446,2450,2454,2458,2462],{"type":32,"tag":63,"props":2447,"children":2448},{"style":86},[2449],{"type":37,"value":2257},{"type":32,"tag":63,"props":2451,"children":2452},{"style":80},[2453],{"type":37,"value":259},{"type":32,"tag":63,"props":2455,"children":2456},{"style":86},[2457],{"type":37,"value":89},{"type":32,"tag":63,"props":2459,"children":2460},{"style":92},[2461],{"type":37,"value":268},{"type":32,"tag":63,"props":2463,"children":2464},{"style":86},[2465],{"type":37,"value":1363},{"type":32,"tag":63,"props":2467,"children":2469},{"class":65,"line":2468},33,[2470],{"type":32,"tag":63,"props":2471,"children":2472},{"style":86},[2473],{"type":37,"value":2281},{"type":32,"tag":63,"props":2475,"children":2477},{"class":65,"line":2476},34,[2478],{"type":32,"tag":63,"props":2479,"children":2480},{"style":86},[2481],{"type":37,"value":2177},{"type":32,"tag":63,"props":2483,"children":2485},{"class":65,"line":2484},35,[2486,2490,2494,2498,2503,2508,2513,2518],{"type":32,"tag":63,"props":2487,"children":2488},{"style":109},[2489],{"type":37,"value":453},{"type":32,"tag":63,"props":2491,"children":2492},{"style":86},[2493],{"type":37,"value":2300},{"type":32,"tag":63,"props":2495,"children":2496},{"style":80},[2497],{"type":37,"value":2047},{"type":32,"tag":63,"props":2499,"children":2500},{"style":86},[2501],{"type":37,"value":2502},"({ error: ",{"type":32,"tag":63,"props":2504,"children":2505},{"style":92},[2506],{"type":37,"value":2507},"'Failed to add to cart'",{"type":32,"tag":63,"props":2509,"children":2510},{"style":86},[2511],{"type":37,"value":2512}," }, { status: ",{"type":32,"tag":63,"props":2514,"children":2515},{"style":209},[2516],{"type":37,"value":2517},"500",{"type":32,"tag":63,"props":2519,"children":2520},{"style":86},[2521],{"type":37,"value":2319},{"type":32,"tag":63,"props":2523,"children":2525},{"class":65,"line":2524},36,[2526],{"type":32,"tag":63,"props":2527,"children":2528},{"style":86},[2529],{"type":37,"value":542},{"type":32,"tag":63,"props":2531,"children":2533},{"class":65,"line":2532},37,[2534],{"type":32,"tag":63,"props":2535,"children":2536},{"style":86},[2537],{"type":37,"value":551},{"type":32,"tag":33,"props":2539,"children":2540},{},[2541],{"type":37,"value":2542},"Aggregare questi log in BigQuery e eseguire anomaly detection:",{"type":32,"tag":52,"props":2544,"children":2548},{"className":2545,"code":2546,"language":2547,"meta":16,"style":16},"language-sql shiki shiki-themes github-dark","-- Confronto giornaliero del tasso di successo ATC\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",[2549],{"type":32,"tag":59,"props":2550,"children":2551},{"__ignoreMap":16},[2552,2560,2568,2603,2637,2670,2678,2703,2740,2767,2789,2838,2851],{"type":32,"tag":63,"props":2553,"children":2554},{"class":65,"line":66},[2555],{"type":32,"tag":63,"props":2556,"children":2557},{"style":70},[2558],{"type":37,"value":2559},"-- Confronto giornaliero del tasso di successo ATC\n",{"type":32,"tag":63,"props":2561,"children":2562},{"class":65,"line":76},[2563],{"type":32,"tag":63,"props":2564,"children":2565},{"style":109},[2566],{"type":37,"value":2567},"SELECT\n",{"type":32,"tag":63,"props":2569,"children":2570},{"class":65,"line":120},[2571,2576,2580,2585,2589,2594,2599],{"type":32,"tag":63,"props":2572,"children":2573},{"style":109},[2574],{"type":37,"value":2575},"  DATE",{"type":32,"tag":63,"props":2577,"children":2578},{"style":86},[2579],{"type":37,"value":89},{"type":32,"tag":63,"props":2581,"children":2582},{"style":109},[2583],{"type":37,"value":2584},"timestamp",{"type":32,"tag":63,"props":2586,"children":2587},{"style":86},[2588],{"type":37,"value":273},{"type":32,"tag":63,"props":2590,"children":2591},{"style":109},[2592],{"type":37,"value":2593},"AS",{"type":32,"tag":63,"props":2595,"children":2596},{"style":109},[2597],{"type":37,"value":2598}," date",{"type":32,"tag":63,"props":2600,"children":2601},{"style":86},[2602],{"type":37,"value":1188},{"type":32,"tag":63,"props":2604,"children":2605},{"class":65,"line":148},[2606,2611,2615,2619,2624,2628,2632],{"type":32,"tag":63,"props":2607,"children":2608},{"style":86},[2609],{"type":37,"value":2610},"  COUNTIF(",{"type":32,"tag":63,"props":2612,"children":2613},{"style":109},[2614],{"type":37,"value":106},{"type":32,"tag":63,"props":2616,"children":2617},{"style":109},[2618],{"type":37,"value":217},{"type":32,"tag":63,"props":2620,"children":2621},{"style":92},[2622],{"type":37,"value":2623}," 'add_to_cart_success'",{"type":32,"tag":63,"props":2625,"children":2626},{"style":86},[2627],{"type":37,"value":273},{"type":32,"tag":63,"props":2629,"children":2630},{"style":109},[2631],{"type":37,"value":2593},{"type":32,"tag":63,"props":2633,"children":2634},{"style":86},[2635],{"type":37,"value":2636}," success_count,\n",{"type":32,"tag":63,"props":2638,"children":2639},{"class":65,"line":157},[2640,2644,2648,2652,2657,2661,2665],{"type":32,"tag":63,"props":2641,"children":2642},{"style":86},[2643],{"type":37,"value":2610},{"type":32,"tag":63,"props":2645,"children":2646},{"style":109},[2647],{"type":37,"value":106},{"type":32,"tag":63,"props":2649,"children":2650},{"style":109},[2651],{"type":37,"value":217},{"type":32,"tag":63,"props":2653,"children":2654},{"style":92},[2655],{"type":37,"value":2656}," 'add_to_cart_failure'",{"type":32,"tag":63,"props":2658,"children":2659},{"style":86},[2660],{"type":37,"value":273},{"type":32,"tag":63,"props":2662,"children":2663},{"style":109},[2664],{"type":37,"value":2593},{"type":32,"tag":63,"props":2666,"children":2667},{"style":86},[2668],{"type":37,"value":2669}," failure_count,\n",{"type":32,"tag":63,"props":2671,"children":2672},{"class":65,"line":167},[2673],{"type":32,"tag":63,"props":2674,"children":2675},{"style":86},[2676],{"type":37,"value":2677},"  SAFE_DIVIDE(\n",{"type":32,"tag":63,"props":2679,"children":2680},{"class":65,"line":200},[2681,2686,2690,2694,2698],{"type":32,"tag":63,"props":2682,"children":2683},{"style":86},[2684],{"type":37,"value":2685},"    COUNTIF(",{"type":32,"tag":63,"props":2687,"children":2688},{"style":109},[2689],{"type":37,"value":106},{"type":32,"tag":63,"props":2691,"children":2692},{"style":109},[2693],{"type":37,"value":217},{"type":32,"tag":63,"props":2695,"children":2696},{"style":92},[2697],{"type":37,"value":2623},{"type":32,"tag":63,"props":2699,"children":2700},{"style":86},[2701],{"type":37,"value":2702},"),\n",{"type":32,"tag":63,"props":2704,"children":2705},{"class":65,"line":235},[2706,2710,2714,2719,2723,2727,2731,2735],{"type":32,"tag":63,"props":2707,"children":2708},{"style":86},[2709],{"type":37,"value":2685},{"type":32,"tag":63,"props":2711,"children":2712},{"style":109},[2713],{"type":37,"value":106},{"type":32,"tag":63,"props":2715,"children":2716},{"style":109},[2717],{"type":37,"value":2718}," IN",{"type":32,"tag":63,"props":2720,"children":2721},{"style":86},[2722],{"type":37,"value":350},{"type":32,"tag":63,"props":2724,"children":2725},{"style":92},[2726],{"type":37,"value":2216},{"type":32,"tag":63,"props":2728,"children":2729},{"style":86},[2730],{"type":37,"value":100},{"type":32,"tag":63,"props":2732,"children":2733},{"style":92},[2734],{"type":37,"value":2405},{"type":32,"tag":63,"props":2736,"children":2737},{"style":86},[2738],{"type":37,"value":2739},"))\n",{"type":32,"tag":63,"props":2741,"children":2742},{"class":65,"line":26},[2743,2748,2753,2757,2762],{"type":32,"tag":63,"props":2744,"children":2745},{"style":86},[2746],{"type":37,"value":2747},"  ) ",{"type":32,"tag":63,"props":2749,"children":2750},{"style":109},[2751],{"type":37,"value":2752},"*",{"type":32,"tag":63,"props":2754,"children":2755},{"style":209},[2756],{"type":37,"value":370},{"type":32,"tag":63,"props":2758,"children":2759},{"style":109},[2760],{"type":37,"value":2761}," AS",{"type":32,"tag":63,"props":2763,"children":2764},{"style":86},[2765],{"type":37,"value":2766}," success_rate_percent\n",{"type":32,"tag":63,"props":2768,"children":2769},{"class":65,"line":322},[2770,2775,2780,2784],{"type":32,"tag":63,"props":2771,"children":2772},{"style":109},[2773],{"type":37,"value":2774},"FROM",{"type":32,"tag":63,"props":2776,"children":2777},{"style":209},[2778],{"type":37,"value":2779}," analytics",{"type":32,"tag":63,"props":2781,"children":2782},{"style":86},[2783],{"type":37,"value":1772},{"type":32,"tag":63,"props":2785,"children":2786},{"style":209},[2787],{"type":37,"value":2788},"events\n",{"type":32,"tag":63,"props":2790,"children":2791},{"class":65,"line":331},[2792,2797,2802,2806,2810,2814,2819,2824,2829,2834],{"type":32,"tag":63,"props":2793,"children":2794},{"style":109},[2795],{"type":37,"value":2796},"WHERE",{"type":32,"tag":63,"props":2798,"children":2799},{"style":109},[2800],{"type":37,"value":2801}," DATE",{"type":32,"tag":63,"props":2803,"children":2804},{"style":86},[2805],{"type":37,"value":89},{"type":32,"tag":63,"props":2807,"children":2808},{"style":109},[2809],{"type":37,"value":2584},{"type":32,"tag":63,"props":2811,"children":2812},{"style":86},[2813],{"type":37,"value":273},{"type":32,"tag":63,"props":2815,"children":2816},{"style":109},[2817],{"type":37,"value":2818},">=",{"type":32,"tag":63,"props":2820,"children":2821},{"style":86},[2822],{"type":37,"value":2823}," DATE_SUB(CURRENT_DATE(), INTERVAL ",{"type":32,"tag":63,"props":2825,"children":2826},{"style":209},[2827],{"type":37,"value":2828},"7",{"type":32,"tag":63,"props":2830,"children":2831},{"style":109},[2832],{"type":37,"value":2833}," DAY",{"type":32,"tag":63,"props":2835,"children":2836},{"style":86},[2837],{"type":37,"value":1363},{"type":32,"tag":63,"props":2839,"children":2840},{"class":65,"line":387},[2841,2846],{"type":32,"tag":63,"props":2842,"children":2843},{"style":109},[2844],{"type":37,"value":2845},"GROUP BY",{"type":32,"tag":63,"props":2847,"children":2848},{"style":109},[2849],{"type":37,"value":2850}," date\n",{"type":32,"tag":63,"props":2852,"children":2853},{"class":65,"line":395},[2854,2859,2863],{"type":32,"tag":63,"props":2855,"children":2856},{"style":109},[2857],{"type":37,"value":2858},"ORDER BY",{"type":32,"tag":63,"props":2860,"children":2861},{"style":109},[2862],{"type":37,"value":2598},{"type":32,"tag":63,"props":2864,"children":2865},{"style":109},[2866],{"type":37,"value":2867}," DESC\n",{"type":32,"tag":33,"props":2869,"children":2870},{},[2871,2873,2879],{"type":37,"value":2872},"Se il tasso di successo scende sotto il 99%, è possibile configurare un allarme (webhook Slack, PagerDuty). Controllare anche la metrica ",{"type":32,"tag":59,"props":2874,"children":2876},{"className":2875},[],[2877],{"type":37,"value":2878},"duration",{"type":37,"value":2880},": se il tempo medio di risposta ATC nello stack legacy è 120ms, nel sistema headless dovrebbe essere 80ms — se sale a 200ms, è necessario ottimizzare le query del database.",{"type":32,"tag":819,"props":2882,"children":2884},{"id":2883},"session-replay-e-error-tracking",[2885],{"type":37,"value":2886},"Session Replay e Error Tracking",{"type":32,"tag":33,"props":2888,"children":2889},{},[2890],{"type":37,"value":2891},"Integrare uno strumento di session replay come Sentry o LogRocket. Associare gli eventi di failure ATC all'ID della sessione e visualizzare l'intero percorso dell'utente: in quale fase il pulsante è rimasto disabilitato, quale richiesta di rete è andata in timeout. Nei progetti di migrazione headless di Roibase, il 60% dei bug identificati tramite session replay derivano da race condition — ad esempio, l'API di verifica dell'inventario non si completa prima della mutazione del carrello, causando l'attivazione prematura del pulsante.",{"type":32,"tag":40,"props":2893,"children":2895},{"id":2894},"metriche-di-performance-core-web-vitals-e-costo-runtime",[2896],{"type":37,"value":2897},"Metriche di Performance: Core Web Vitals e Costo Runtime",{"type":32,"tag":33,"props":2899,"children":2900},{},[2901],{"type":37,"value":2902},"Lo scopo principale della migrazione headless è migliorare le prestazioni. Tuttavia, un sistema headless implementato male può essere PIÙ LENTO di Shopify monolitico. Se si utilizza il rendering lato client (CSR), il LCP può raggiungere 4+ secondi; l'approccio corretto è il rendering lato server (SSR) o la generazione statica del sito (SSG) + rigenerazione statica incrementale (ISR).",{"type":32,"tag":33,"props":2904,"children":2905},{},[2906],{"type":37,"value":2907},"Esempio di ISR per la pagina di dettaglio del prodotto in Next.js App Router:",{"type":32,"tag":52,"props":2909,"children":2913},{"className":2910,"code":2911,"language":2912,"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 Rigenerare ogni 1 ora\n\nexport async function generateStaticParams() {\n  const products = await getTopProducts(100) \u002F\u002F Pre-renderizza i primi 100 prodotti\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",[2914],{"type":32,"tag":59,"props":2915,"children":2916},{"__ignoreMap":16},[2917,2924,2955,2962,2987,3030,3064,3071,3078,3114,3144,3151,3162,3180,3205,3255,3281,3297,3304],{"type":32,"tag":63,"props":2918,"children":2919},{"class":65,"line":66},[2920],{"type":32,"tag":63,"props":2921,"children":2922},{"style":70},[2923],{"type":37,"value":1438},{"type":32,"tag":63,"props":2925,"children":2926},{"class":65,"line":76},[2927,2931,2936,2941,2945,2950],{"type":32,"tag":63,"props":2928,"children":2929},{"style":109},[2930],{"type":37,"value":1446},{"type":32,"tag":63,"props":2932,"children":2933},{"style":109},[2934],{"type":37,"value":2935}," const",{"type":32,"tag":63,"props":2937,"children":2938},{"style":209},[2939],{"type":37,"value":2940}," revalidate",{"type":32,"tag":63,"props":2942,"children":2943},{"style":109},[2944],{"type":37,"value":217},{"type":32,"tag":63,"props":2946,"children":2947},{"style":209},[2948],{"type":37,"value":2949}," 3600",{"type":32,"tag":63,"props":2951,"children":2952},{"style":70},[2953],{"type":37,"value":2954}," \u002F\u002F Rigenerare ogni 1 ora\n",{"type":32,"tag":63,"props":2956,"children":2957},{"class":65,"line":120},[2958],{"type":32,"tag":63,"props":2959,"children":2960},{"emptyLinePlaceholder":161},[2961],{"type":37,"value":164},{"type":32,"tag":63,"props":2963,"children":2964},{"class":65,"line":148},[2965,2969,2973,2977,2982],{"type":32,"tag":63,"props":2966,"children":2967},{"style":109},[2968],{"type":37,"value":1446},{"type":32,"tag":63,"props":2970,"children":2971},{"style":109},[2972],{"type":37,"value":1966},{"type":32,"tag":63,"props":2974,"children":2975},{"style":109},[2976],{"type":37,"value":178},{"type":32,"tag":63,"props":2978,"children":2979},{"style":80},[2980],{"type":37,"value":2981}," generateStaticParams",{"type":32,"tag":63,"props":2983,"children":2984},{"style":86},[2985],{"type":37,"value":2986},"() {\n",{"type":32,"tag":63,"props":2988,"children":2989},{"class":65,"line":157},[2990,2994,2999,3003,3007,3012,3016,3021,3025],{"type":32,"tag":63,"props":2991,"children":2992},{"style":109},[2993],{"type":37,"value":206},{"type":32,"tag":63,"props":2995,"children":2996},{"style":209},[2997],{"type":37,"value":2998}," products",{"type":32,"tag":63,"props":3000,"children":3001},{"style":109},[3002],{"type":37,"value":217},{"type":32,"tag":63,"props":3004,"children":3005},{"style":109},[3006],{"type":37,"value":2037},{"type":32,"tag":63,"props":3008,"children":3009},{"style":80},[3010],{"type":37,"value":3011}," getTopProducts",{"type":32,"tag":63,"props":3013,"children":3014},{"style":86},[3015],{"type":37,"value":89},{"type":32,"tag":63,"props":3017,"children":3018},{"style":209},[3019],{"type":37,"value":3020},"100",{"type":32,"tag":63,"props":3022,"children":3023},{"style":86},[3024],{"type":37,"value":273},{"type":32,"tag":63,"props":3026,"children":3027},{"style":70},[3028],{"type":37,"value":3029},"\u002F\u002F Pre-renderizza i primi 100 prodotti\n",{"type":32,"tag":63,"props":3031,"children":3032},{"class":65,"line":167},[3033,3037,3042,3047,3051,3055,3059],{"type":32,"tag":63,"props":3034,"children":3035},{"style":109},[3036],{"type":37,"value":769},{"type":32,"tag":63,"props":3038,"children":3039},{"style":86},[3040],{"type":37,"value":3041}," products.",{"type":32,"tag":63,"props":3043,"children":3044},{"style":80},[3045],{"type":37,"value":3046},"map",{"type":32,"tag":63,"props":3048,"children":3049},{"style":86},[3050],{"type":37,"value":89},{"type":32,"tag":63,"props":3052,"children":3053},{"style":103},[3054],{"type":37,"value":33},{"type":32,"tag":63,"props":3056,"children":3057},{"style":109},[3058],{"type":37,"value":112},{"type":32,"tag":63,"props":3060,"children":3061},{"style":86},[3062],{"type":37,"value":3063}," ({ slug: p.slug }))\n",{"type":32,"tag":63,"props":3065,"children":3066},{"class":65,"line":200},[3067],{"type":32,"tag":63,"props":3068,"children":3069},{"style":86},[3070],{"type":37,"value":551},{"type":32,"tag":63,"props":3072,"children":3073},{"class":65,"line":235},[3074],{"type":32,"tag":63,"props":3075,"children":3076},{"emptyLinePlaceholder":161},[3077],{"type":37,"value":164},{"type":32,"tag":63,"props":3079,"children":3080},{"class":65,"line":26},[3081,3085,3089,3093,3097,3101,3105,3110],{"type":32,"tag":63,"props":3082,"children":3083},{"style":109},[3084],{"type":37,"value":1446},{"type":32,"tag":63,"props":3086,"children":3087},{"style":109},[3088],{"type":37,"value":1451},{"type":32,"tag":63,"props":3090,"children":3091},{"style":109},[3092],{"type":37,"value":1966},{"type":32,"tag":63,"props":3094,"children":3095},{"style":109},[3096],{"type":37,"value":178},{"type":32,"tag":63,"props":3098,"children":3099},{"style":80},[3100],{"type":37,"value":1460},{"type":32,"tag":63,"props":3102,"children":3103},{"style":86},[3104],{"type":37,"value":1465},{"type":32,"tag":63,"props":3106,"children":3107},{"style":103},[3108],{"type":37,"value":3109},"params",{"type":32,"tag":63,"props":3111,"children":3112},{"style":86},[3113],{"type":37,"value":1475},{"type":32,"tag":63,"props":3115,"children":3116},{"class":65,"line":322},[3117,3121,3126,3130,3134,3139],{"type":32,"tag":63,"props":3118,"children":3119},{"style":109},[3120],{"type":37,"value":206},{"type":32,"tag":63,"props":3122,"children":3123},{"style":209},[3124],{"type":37,"value":3125}," product",{"type":32,"tag":63,"props":3127,"children":3128},{"style":109},[3129],{"type":37,"value":217},{"type":32,"tag":63,"props":3131,"children":3132},{"style":109},[3133],{"type":37,"value":2037},{"type":32,"tag":63,"props":3135,"children":3136},{"style":80},[3137],{"type":37,"value":3138}," getProduct",{"type":32,"tag":63,"props":3140,"children":3141},{"style":86},[3142],{"type":37,"value":3143},"(params.slug)\n",{"type":32,"tag":63,"props":3145,"children":3146},{"class":65,"line":331},[3147],{"type":32,"tag":63,"props":3148,"children":3149},{"style":86},[3150],{"type":37,"value":328},{"type":32,"tag":63,"props":3152,"children":3153},{"class":65,"line":387},[3154,3158],{"type":32,"tag":63,"props":3155,"children":3156},{"style":109},[3157],{"type":37,"value":769},{"type":32,"tag":63,"props":3159,"children":3160},{"style":86},[3161],{"type":37,"value":1707},{"type":32,"tag":63,"props":3163,"children":3164},{"class":65,"line":395},[3165,3170,3175],{"type":32,"tag":63,"props":3166,"children":3167},{"style":86},[3168],{"type":37,"value":3169},"    \u003C",{"type":32,"tag":63,"props":3171,"children":3172},{"style":857},[3173],{"type":37,"value":3174},"div",{"type":32,"tag":63,"props":3176,"children":3177},{"style":86},[3178],{"type":37,"value":3179},">\n",{"type":32,"tag":63,"props":3181,"children":3182},{"class":65,"line":438},[3183,3187,3192,3197,3201],{"type":32,"tag":63,"props":3184,"children":3185},{"style":86},[3186],{"type":37,"value":1723},{"type":32,"tag":63,"props":3188,"children":3189},{"style":857},[3190],{"type":37,"value":3191},"h1",{"type":32,"tag":63,"props":3193,"children":3194},{"style":86},[3195],{"type":37,"value":3196},">{product.title}\u003C\u002F",{"type":32,"tag":63,"props":3198,"children":3199},{"style":857},[3200],{"type":37,"value":3191},{"type":32,"tag":63,"props":3202,"children":3203},{"style":86},[3204],{"type":37,"value":3179},{"type":32,"tag":63,"props":3206,"children":3207},{"class":65,"line":447},[3208,3212,3217,3222,3226,3231,3236,3240,3245,3250],{"type":32,"tag":63,"props":3209,"children":3210},{"style":86},[3211],{"type":37,"value":1723},{"type":32,"tag":63,"props":3213,"children":3214},{"style":209},[3215],{"type":37,"value":3216},"Image",{"type":32,"tag":63,"props":3218,"children":3219},{"style":80},[3220],{"type":37,"value":3221}," src",{"type":32,"tag":63,"props":3223,"children":3224},{"style":109},[3225],{"type":37,"value":605},{"type":32,"tag":63,"props":3227,"children":3228},{"style":86},[3229],{"type":37,"value":3230},"{product.image} ",{"type":32,"tag":63,"props":3232,"children":3233},{"style":80},[3234],{"type":37,"value":3235},"alt",{"type":32,"tag":63,"props":3237,"children":3238},{"style":109},[3239],{"type":37,"value":605},{"type":32,"tag":63,"props":3241,"children":3242},{"style":86},[3243],{"type":37,"value":3244},"{product.title} ",{"type":32,"tag":63,"props":3246,"children":3247},{"style":80},[3248],{"type":37,"value":3249},"priority",{"type":32,"tag":63,"props":3251,"children":3252},{"style":86},[3253],{"type":37,"value":3254}," \u002F>\n",{"type":32,"tag":63,"props":3256,"children":3257},{"class":65,"line":480},[3258,3262,3267,3272,3276],{"type":32,"tag":63,"props":3259,"children":3260},{"style":86},[3261],{"type":37,"value":1723},{"type":32,"tag":63,"props":3263,"children":3264},{"style":209},[3265],{"type":37,"value":3266},"AddToCartButton",{"type":32,"tag":63,"props":3268,"children":3269},{"style":80},[3270],{"type":37,"value":3271}," productId",{"type":32,"tag":63,"props":3273,"children":3274},{"style":109},[3275],{"type":37,"value":605},{"type":32,"tag":63,"props":3277,"children":3278},{"style":86},[3279],{"type":37,"value":3280},"{product.id} \u002F>\n",{"type":32,"tag":63,"props":3282,"children":3283},{"class":65,"line":498},[3284,3289,3293],{"type":32,"tag":63,"props":3285,"children":3286},{"style":86},[3287],{"type":37,"value":3288},"    \u003C\u002F",{"type":32,"tag":63,"props":3290,"children":3291},{"style":857},[3292],{"type":37,"value":3174},{"type":32,"tag":63,"props":3294,"children":3295},{"style":86},[3296],{"type":37,"value":3179},{"type":32,"tag":63,"props":3298,"children":3299},{"class":65,"line":507},[3300],{"type":32,"tag":63,"props":3301,"children":3302},{"style":86},[3303],{"type":37,"value":1823},{"type":32,"tag":63,"props":3305,"children":3306},{"class":65,"line":536},[3307],{"type":32,"tag":63,"props":3308,"children":3309},{"style":86},[3310],{"type":37,"value":551},{"type":32,"tag":33,"props":3312,"children":3313},{},[3314],{"type":37,"value":3315},"In questa configurazione, i primi 100 prodotti vengono generati al momento del build, i rimanenti vengono renderizzati on-demand alla prima richiesta e cachati per 1 ora. Il LCP scende sotto 1,2s perché l'HTML è già pronto e occorre solo il caricamento dell'immagine.",{"type":32,"tag":33,"props":3317,"children":3318},{},[3319],{"type":37,"value":3320},"Misurare anche il costo runtime: numero di invocazioni della funzione serverless × tempo di esecuzione × pricing. Su Vercel, se una pagina SSR impiega in media 50ms e riceve 100.000 visualizzazioni giornaliere: 100k × 50ms = 5 milioni GB-s, equivalenti a $25\u002Fgiorno (pricing del piano Vercel Pro). Per ridurlo:",{"type":32,"tag":3322,"props":3323,"children":3324},"ol",{},[3325,3339,3344],{"type":32,"tag":3326,"props":3327,"children":3328},"li",{},[3329,3331,3337],{"type":37,"value":3330},"Caching Edge — attivare cache CDN con ",{"type":32,"tag":59,"props":3332,"children":3334},{"className":3333},[],[3335],{"type":37,"value":3336},"Cache-Control: s-maxage=3600",{"type":37,"value":3338}," su Cloudflare",{"type":32,"tag":3326,"props":3340,"children":3341},{},[3342],{"type":37,"value":3343},"Partial hydration — utilizzare Astro o Qwik, idratare solo i componenti interattivi",{"type":32,"tag":3326,"props":3345,"children":3346},{},[3347,3349,3355],{"type":37,"value":3348},"Ottimizzazione query database — se c'è il problema N+1, usare ",{"type":32,"tag":59,"props":3350,"children":3352},{"className":3351},[],[3353],{"type":37,"value":3354},"include",{"type":37,"value":3356}," in Prisma per ridurre 10 query a 1",{"type":32,"tag":1025,"props":3358,"children":3359},{},[3360,3385],{"type":32,"tag":1029,"props":3361,"children":3362},{},[3363],{"type":32,"tag":1033,"props":3364,"children":3365},{},[3366,3371,3375,3380],{"type":32,"tag":1037,"props":3367,"children":3368},{},[3369],{"type":37,"value":3370},"Metrica",{"type":32,"tag":1037,"props":3372,"children":3373},{},[3374],{"type":37,"value":1041},{"type":32,"tag":1037,"props":3376,"children":3377},{},[3378],{"type":37,"value":3379},"Nuovo (Next.js SSR)",{"type":32,"tag":1037,"props":3381,"children":3382},{},[3383],{"type":37,"value":3384},"Target",{"type":32,"tag":1053,"props":3386,"children":3387},{},[3388,3411,3434,3457,3480],{"type":32,"tag":1033,"props":3389,"children":3390},{},[3391,3396,3401,3406],{"type":32,"tag":1060,"props":3392,"children":3393},{},[3394],{"type":37,"value":3395},"LCP",{"type":32,"tag":1060,"props":3397,"children":3398},{},[3399],{"type":37,"value":3400},"2,3s",{"type":32,"tag":1060,"props":3402,"children":3403},{},[3404],{"type":37,"value":3405},"1,8s",{"type":32,"tag":1060,"props":3407,"children":3408},{},[3409],{"type":37,"value":3410},"\u003C2,5s",{"type":32,"tag":1033,"props":3412,"children":3413},{},[3414,3419,3424,3429],{"type":32,"tag":1060,"props":3415,"children":3416},{},[3417],{"type":37,"value":3418},"TBT",{"type":32,"tag":1060,"props":3420,"children":3421},{},[3422],{"type":37,"value":3423},"190ms",{"type":32,"tag":1060,"props":3425,"children":3426},{},[3427],{"type":37,"value":3428},"120ms",{"type":32,"tag":1060,"props":3430,"children":3431},{},[3432],{"type":37,"value":3433},"\u003C200ms",{"type":32,"tag":1033,"props":3435,"children":3436},{},[3437,3442,3447,3452],{"type":32,"tag":1060,"props":3438,"children":3439},{},[3440],{"type":37,"value":3441},"CLS",{"type":32,"tag":1060,"props":3443,"children":3444},{},[3445],{"type":37,"value":3446},"0,08",{"type":32,"tag":1060,"props":3448,"children":3449},{},[3450],{"type":37,"value":3451},"0,02",{"type":32,"tag":1060,"props":3453,"children":3454},{},[3455],{"type":37,"value":3456},"\u003C0,1",{"type":32,"tag":1033,"props":3458,"children":3459},{},[3460,3465,3470,3475],{"type":32,"tag":1060,"props":3461,"children":3462},{},[3463],{"type":37,"value":3464},"Server response time",{"type":32,"tag":1060,"props":3466,"children":3467},{},[3468],{"type":37,"value":3469},"420ms",{"type":32,"tag":1060,"props":3471,"children":3472},{},[3473],{"type":37,"value":3474},"180ms",{"type":32,"tag":1060,"props":3476,"children":3477},{},[3478],{"type":37,"value":3479},"\u003C300ms",{"type":32,"tag":1033,"props":3481,"children":3482},{},[3483,3488,3493,3498],{"type":32,"tag":1060,"props":3484,"children":3485},{},[3486],{"type":37,"value":3487},"Costo runtime mensile",{"type":32,"tag":1060,"props":3489,"children":3490},{},[3491],{"type":37,"value":3492},"$0 (incluso)",{"type":32,"tag":1060,"props":3494,"children":3495},{},[3496],{"type":37,"value":3497},"$750 (Vercel Pro)",{"type":32,"tag":1060,"props":3499,"children":3500},{},[3501],{"type":37,"value":3502},"\u003C$1000",{"type":32,"tag":40,"props":3504,"children":3506},{"id":3505},"strategia-di-rollback-e-periodo-di-dual-run",[3507],{"type":37,"value":3508},"Strategia di Rollback e Periodo di Dual-Run",{"type":32,"tag":33,"props":3510,"children":3511},{},[3512],{"type":37,"value":3513},"L'ultima fase della migrazione è il periodo di dual-run",{"type":32,"tag":3515,"props":3516,"children":3517},"style",{},[3518],{"type":37,"value":3519},"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":120,"depth":120,"links":3521},[3522,3525,3528,3531,3532],{"id":42,"depth":76,"text":45,"children":3523},[3524],{"id":821,"depth":120,"text":824},{"id":1010,"depth":76,"text":1013,"children":3526},[3527],{"id":1838,"depth":120,"text":1841},{"id":1875,"depth":76,"text":1878,"children":3529},[3530],{"id":2883,"depth":120,"text":2886},{"id":2894,"depth":76,"text":2897},{"id":3505,"depth":76,"text":3508},"markdown","content:it:tech:migrazione-headless-e-commerce-roadmap-e-gestione-rischi.md","content","it\u002Ftech\u002Fmigrazione-headless-e-commerce-roadmap-e-gestione-rischi.md","it\u002Ftech\u002Fmigrazione-headless-e-commerce-roadmap-e-gestione-rischi","md",1783289079666]