[{"data":1,"prerenderedAt":1746},["ShallowReactive",2],{"article-alternates":3,"article-\u002Fit\u002Ftech\u002Fstrategie-prerender-nuxt-3-e-ottimizzazione-build":13},{"i18nKey":4,"paths":5},"tech-007-2026-07",{"de":6,"en":7,"es":8,"fr":9,"it":10,"ru":11,"tr":12},"\u002Fde\u002Ftech\u002Fssg-leitfaden-fuer-nuxt-3","\u002Fen\u002Ftech\u002Fnuxt-3-ssg-prerender-strategies-and-build-optimization","\u002Fes\u002Ftech\u002Festrategia-ssg-nuxt-3-prerrender-optimizacion-build","\u002Ffr\u002Ftech\u002Fguide-ssg-nuxt-3-strategies-build-optimization","\u002Fit\u002Ftech\u002Fstrategie-prerender-nuxt-3-e-ottimizzazione-build","\u002Fru\u002Ftech\u002Fssg-strategii-dlya-nuxt-3","\u002Ftr\u002Ftech\u002Fnuxt-3-ssg-prerender-stratejileri-ve-build-optimizasyonu",{"_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":1740,"_id":1741,"_source":1742,"_file":1743,"_stem":1744,"_extension":1745},"tech",false,"","Nuxt 3 SSG: Strategie di Prerender e Ottimizzazione Build","Guida tecnica approfondita sulle capacità di static generation di Nuxt 3. Route rules, nitro prerender, incremental static regeneration.","2026-07-19",[21,22,23,24,25],"nuxt3","ssg","static-generation","prerender","web-performance",8,"Roibase",{"type":29,"children":30,"toc":1724},"root",[31,48,55,68,272,293,300,305,324,341,346,352,357,493,514,520,533,761,766,772,777,900,912,918,931,1012,1025,1031,1044,1188,1201,1207,1220,1325,1335,1341,1346,1354,1435,1446,1454,1496,1501,1511,1601,1606,1612,1617,1643,1661,1693,1709,1713,1718],{"type":32,"tag":33,"props":34,"children":35},"element","p",{},[36,39,46],{"type":37,"value":38},"text","Il motore di static site generation (SSG) di Nuxt 3, Nitro, rappresenta la prima soluzione production-grade nell'ecosistema Vue che combina ISR (Incremental Static Regeneration) e controllo del prerender a livello di route. Nel 2026, sebbene alcuni affermassero che l'SSG fosse obsoleto con la diffusione delle piattaforme edge, in realtà le strategie di rendering ibride (SSG + ISR on-demand) si sono rivelate il modo più cost-effective per ottimizzare i Core Web Vitals. L'API ",{"type":32,"tag":40,"props":41,"children":43},"code",{"className":42},[],[44],{"type":37,"value":45},"routeRules",{"type":37,"value":47}," di Nuxt 3 consente di gestire questa architettura ibrida in un unico file di configurazione.",{"type":32,"tag":49,"props":50,"children":52},"h2",{"id":51},"strategia-di-rendering-a-livello-di-route",[53],{"type":37,"value":54},"Strategia di Rendering a Livello di Route",{"type":32,"tag":33,"props":56,"children":57},{},[58,60,66],{"type":37,"value":59},"In Nuxt 3, la modalità di rendering non viene più determinata a livello di applicazione, bensì a livello di singola route. All'interno di ",{"type":32,"tag":40,"props":61,"children":63},{"className":62},[],[64],{"type":37,"value":65},"nuxt.config.ts",{"type":37,"value":67}," è possibile definire una strategia distinta per ogni route:",{"type":32,"tag":69,"props":70,"children":74},"pre",{"className":71,"code":72,"language":73,"meta":16,"style":16},"language-typescript shiki shiki-themes github-dark","export default defineNuxtConfig({\n  routeRules: {\n    '\u002F': { prerender: true },\n    '\u002Fblog\u002F**': { swr: 3600 },\n    '\u002Fapi\u002F**': { cors: true, headers: { 'cache-control': 's-maxage=0' } },\n    '\u002Fadmin\u002F**': { ssr: false },\n    '\u002Fproduct\u002F**': { isr: 60 }\n  }\n})\n","typescript",[75],{"type":32,"tag":40,"props":76,"children":77},{"__ignoreMap":16},[78,107,116,142,165,208,231,255,263],{"type":32,"tag":79,"props":80,"children":83},"span",{"class":81,"line":82},"line",1,[84,90,95,101],{"type":32,"tag":79,"props":85,"children":87},{"style":86},"--shiki-default:#F97583",[88],{"type":37,"value":89},"export",{"type":32,"tag":79,"props":91,"children":92},{"style":86},[93],{"type":37,"value":94}," default",{"type":32,"tag":79,"props":96,"children":98},{"style":97},"--shiki-default:#B392F0",[99],{"type":37,"value":100}," defineNuxtConfig",{"type":32,"tag":79,"props":102,"children":104},{"style":103},"--shiki-default:#E1E4E8",[105],{"type":37,"value":106},"({\n",{"type":32,"tag":79,"props":108,"children":110},{"class":81,"line":109},2,[111],{"type":32,"tag":79,"props":112,"children":113},{"style":103},[114],{"type":37,"value":115},"  routeRules: {\n",{"type":32,"tag":79,"props":117,"children":119},{"class":81,"line":118},3,[120,126,131,137],{"type":32,"tag":79,"props":121,"children":123},{"style":122},"--shiki-default:#9ECBFF",[124],{"type":37,"value":125},"    '\u002F'",{"type":32,"tag":79,"props":127,"children":128},{"style":103},[129],{"type":37,"value":130},": { prerender: ",{"type":32,"tag":79,"props":132,"children":134},{"style":133},"--shiki-default:#79B8FF",[135],{"type":37,"value":136},"true",{"type":32,"tag":79,"props":138,"children":139},{"style":103},[140],{"type":37,"value":141}," },\n",{"type":32,"tag":79,"props":143,"children":145},{"class":81,"line":144},4,[146,151,156,161],{"type":32,"tag":79,"props":147,"children":148},{"style":122},[149],{"type":37,"value":150},"    '\u002Fblog\u002F**'",{"type":32,"tag":79,"props":152,"children":153},{"style":103},[154],{"type":37,"value":155},": { swr: ",{"type":32,"tag":79,"props":157,"children":158},{"style":133},[159],{"type":37,"value":160},"3600",{"type":32,"tag":79,"props":162,"children":163},{"style":103},[164],{"type":37,"value":141},{"type":32,"tag":79,"props":166,"children":168},{"class":81,"line":167},5,[169,174,179,183,188,193,198,203],{"type":32,"tag":79,"props":170,"children":171},{"style":122},[172],{"type":37,"value":173},"    '\u002Fapi\u002F**'",{"type":32,"tag":79,"props":175,"children":176},{"style":103},[177],{"type":37,"value":178},": { cors: ",{"type":32,"tag":79,"props":180,"children":181},{"style":133},[182],{"type":37,"value":136},{"type":32,"tag":79,"props":184,"children":185},{"style":103},[186],{"type":37,"value":187},", headers: { ",{"type":32,"tag":79,"props":189,"children":190},{"style":122},[191],{"type":37,"value":192},"'cache-control'",{"type":32,"tag":79,"props":194,"children":195},{"style":103},[196],{"type":37,"value":197},": ",{"type":32,"tag":79,"props":199,"children":200},{"style":122},[201],{"type":37,"value":202},"'s-maxage=0'",{"type":32,"tag":79,"props":204,"children":205},{"style":103},[206],{"type":37,"value":207}," } },\n",{"type":32,"tag":79,"props":209,"children":211},{"class":81,"line":210},6,[212,217,222,227],{"type":32,"tag":79,"props":213,"children":214},{"style":122},[215],{"type":37,"value":216},"    '\u002Fadmin\u002F**'",{"type":32,"tag":79,"props":218,"children":219},{"style":103},[220],{"type":37,"value":221},": { ssr: ",{"type":32,"tag":79,"props":223,"children":224},{"style":133},[225],{"type":37,"value":226},"false",{"type":32,"tag":79,"props":228,"children":229},{"style":103},[230],{"type":37,"value":141},{"type":32,"tag":79,"props":232,"children":234},{"class":81,"line":233},7,[235,240,245,250],{"type":32,"tag":79,"props":236,"children":237},{"style":122},[238],{"type":37,"value":239},"    '\u002Fproduct\u002F**'",{"type":32,"tag":79,"props":241,"children":242},{"style":103},[243],{"type":37,"value":244},": { isr: ",{"type":32,"tag":79,"props":246,"children":247},{"style":133},[248],{"type":37,"value":249},"60",{"type":32,"tag":79,"props":251,"children":252},{"style":103},[253],{"type":37,"value":254}," }\n",{"type":32,"tag":79,"props":256,"children":257},{"class":81,"line":26},[258],{"type":32,"tag":79,"props":259,"children":260},{"style":103},[261],{"type":37,"value":262},"  }\n",{"type":32,"tag":79,"props":264,"children":266},{"class":81,"line":265},9,[267],{"type":32,"tag":79,"props":268,"children":269},{"style":103},[270],{"type":37,"value":271},"})\n",{"type":32,"tag":33,"props":273,"children":274},{},[275,277,283,285,291],{"type":37,"value":276},"Questa struttura offre i seguenti vantaggi: le pagine statiche (landing page, archivi blog) vengono generate al momento della build, mentre il contenuto dinamico (pagine prodotto) viene prerenderizzato on-demand. Per la route ",{"type":32,"tag":40,"props":278,"children":280},{"className":279},[],[281],{"type":37,"value":282},"\u002Fblog\u002F**",{"type":37,"value":284},", l'impostazione ",{"type":32,"tag":40,"props":286,"children":288},{"className":287},[],[289],{"type":37,"value":290},"swr: 3600",{"type":37,"value":292}," garantisce che la pagina venga servita dalla CDN per 1 ora con strategia stale-while-revalidate — l'utente visualizza la versione in cache mentre la revalidazione viene attivata in background.",{"type":32,"tag":294,"props":295,"children":297},"h3",{"id":296},"decisione-tra-isr-e-swr",[298],{"type":37,"value":299},"Decisione tra ISR e SWR",{"type":32,"tag":33,"props":301,"children":302},{},[303],{"type":37,"value":304},"ISR (Incremental Static Regeneration) e SWR (Stale-While-Revalidate) vengono spesso confusi. L'ISR genera pagine on-demand dopo la build, le memorizza in cache e le rinfresca dopo un periodo specificato. SWR è invece un header di cache HTTP — mostra la versione precedente mentre esegue l'aggiornamento in background.",{"type":32,"tag":33,"props":306,"children":307},{},[308,314,316,322],{"type":32,"tag":309,"props":310,"children":311},"strong",{},[312],{"type":37,"value":313},"Scegli ISR:",{"type":37,"value":315}," Per pagine ad alto traffico che si aggiornano raramente, come cataloghi prodotti o contenuti CMS. ",{"type":32,"tag":40,"props":317,"children":319},{"className":318},[],[320],{"type":37,"value":321},"isr: 60",{"type":37,"value":323}," = revalidazione ogni 60 secondi.",{"type":32,"tag":33,"props":325,"children":326},{},[327,332,334,339],{"type":32,"tag":309,"props":328,"children":329},{},[330],{"type":37,"value":331},"Scegli SWR:",{"type":37,"value":333}," Per contenuti dove l'aggiornamento immediato non è critico, come articoli blog o documentazione. ",{"type":32,"tag":40,"props":335,"children":337},{"className":336},[],[338],{"type":37,"value":290},{"type":37,"value":340}," = cache CDN di 1 ora + revalidazione in background.",{"type":32,"tag":33,"props":342,"children":343},{},[344],{"type":37,"value":345},"Nei progetti Roibase, abbiamo ridotto il tempo di build del 73% con ISR (da 12 minuti a 3.2 minuti). Su un sito di e-commerce con 15.000 pagine prodotto, abbiamo prerenderizzato le prime 500 pagine al momento della build e generato le rimanenti on-demand con ISR.",{"type":32,"tag":49,"props":347,"children":349},{"id":348},"crawler-prerender-di-nitro",[350],{"type":37,"value":351},"Crawler Prerender di Nitro",{"type":32,"tag":33,"props":353,"children":354},{},[355],{"type":37,"value":356},"Il motore di prerender di Nuxt 3, Nitro, scansiona automaticamente i link interni generando le pagine correlate al momento della build. Tuttavia, controllare il comportamento di questo crawler è critico per le prestazioni:",{"type":32,"tag":69,"props":358,"children":360},{"className":71,"code":359,"language":73,"meta":16,"style":16},"export default defineNuxtConfig({\n  nitro: {\n    prerender: {\n      crawlLinks: true,\n      ignore: ['\u002Fadmin', '\u002Fapi'],\n      routes: ['\u002Fsitemap.xml', '\u002Frss.xml']\n    }\n  }\n})\n",[361],{"type":32,"tag":40,"props":362,"children":363},{"__ignoreMap":16},[364,383,391,399,416,444,471,479,486],{"type":32,"tag":79,"props":365,"children":366},{"class":81,"line":82},[367,371,375,379],{"type":32,"tag":79,"props":368,"children":369},{"style":86},[370],{"type":37,"value":89},{"type":32,"tag":79,"props":372,"children":373},{"style":86},[374],{"type":37,"value":94},{"type":32,"tag":79,"props":376,"children":377},{"style":97},[378],{"type":37,"value":100},{"type":32,"tag":79,"props":380,"children":381},{"style":103},[382],{"type":37,"value":106},{"type":32,"tag":79,"props":384,"children":385},{"class":81,"line":109},[386],{"type":32,"tag":79,"props":387,"children":388},{"style":103},[389],{"type":37,"value":390},"  nitro: {\n",{"type":32,"tag":79,"props":392,"children":393},{"class":81,"line":118},[394],{"type":32,"tag":79,"props":395,"children":396},{"style":103},[397],{"type":37,"value":398},"    prerender: {\n",{"type":32,"tag":79,"props":400,"children":401},{"class":81,"line":144},[402,407,411],{"type":32,"tag":79,"props":403,"children":404},{"style":103},[405],{"type":37,"value":406},"      crawlLinks: ",{"type":32,"tag":79,"props":408,"children":409},{"style":133},[410],{"type":37,"value":136},{"type":32,"tag":79,"props":412,"children":413},{"style":103},[414],{"type":37,"value":415},",\n",{"type":32,"tag":79,"props":417,"children":418},{"class":81,"line":167},[419,424,429,434,439],{"type":32,"tag":79,"props":420,"children":421},{"style":103},[422],{"type":37,"value":423},"      ignore: [",{"type":32,"tag":79,"props":425,"children":426},{"style":122},[427],{"type":37,"value":428},"'\u002Fadmin'",{"type":32,"tag":79,"props":430,"children":431},{"style":103},[432],{"type":37,"value":433},", ",{"type":32,"tag":79,"props":435,"children":436},{"style":122},[437],{"type":37,"value":438},"'\u002Fapi'",{"type":32,"tag":79,"props":440,"children":441},{"style":103},[442],{"type":37,"value":443},"],\n",{"type":32,"tag":79,"props":445,"children":446},{"class":81,"line":210},[447,452,457,461,466],{"type":32,"tag":79,"props":448,"children":449},{"style":103},[450],{"type":37,"value":451},"      routes: [",{"type":32,"tag":79,"props":453,"children":454},{"style":122},[455],{"type":37,"value":456},"'\u002Fsitemap.xml'",{"type":32,"tag":79,"props":458,"children":459},{"style":103},[460],{"type":37,"value":433},{"type":32,"tag":79,"props":462,"children":463},{"style":122},[464],{"type":37,"value":465},"'\u002Frss.xml'",{"type":32,"tag":79,"props":467,"children":468},{"style":103},[469],{"type":37,"value":470},"]\n",{"type":32,"tag":79,"props":472,"children":473},{"class":81,"line":233},[474],{"type":32,"tag":79,"props":475,"children":476},{"style":103},[477],{"type":37,"value":478},"    }\n",{"type":32,"tag":79,"props":480,"children":481},{"class":81,"line":26},[482],{"type":32,"tag":79,"props":483,"children":484},{"style":103},[485],{"type":37,"value":262},{"type":32,"tag":79,"props":487,"children":488},{"class":81,"line":265},[489],{"type":32,"tag":79,"props":490,"children":491},{"style":103},[492],{"type":37,"value":271},{"type":32,"tag":33,"props":494,"children":495},{},[496,498,504,506,512],{"type":37,"value":497},"L'impostazione ",{"type":32,"tag":40,"props":499,"children":501},{"className":500},[],[502],{"type":37,"value":503},"crawlLinks: true",{"type":37,"value":505}," presenta un rischio: ogni tag ",{"type":32,"tag":40,"props":507,"children":509},{"className":508},[],[510],{"type":37,"value":511},"\u003Ca>",{"type":37,"value":513}," nella pagina viene visitato, potendo causare il prerender di route indesiderate. Ad esempio, i link ai social media nel footer potrebbero essere visitati dal crawler anche se esterni.",{"type":32,"tag":294,"props":515,"children":517},{"id":516},"whitelist-di-route-per-prerender",[518],{"type":37,"value":519},"Whitelist di Route per Prerender",{"type":32,"tag":33,"props":521,"children":522},{},[523,525,531],{"type":37,"value":524},"Per prerenderizzare solo route specifiche in production, utilizza l'array ",{"type":32,"tag":40,"props":526,"children":528},{"className":527},[],[529],{"type":37,"value":530},"routes",{"type":37,"value":532},":",{"type":32,"tag":69,"props":534,"children":536},{"className":71,"code":535,"language":73,"meta":16,"style":16},"nitro: {\n  prerender: {\n    crawlLinks: false,\n    routes: async () => {\n      const { data: posts } = await $fetch('\u002Fapi\u002Fposts')\n      return posts.map(p => `\u002Fblog\u002F${p.slug}`)\n    }\n  }\n}\n",[537],{"type":32,"tag":40,"props":538,"children":539},{"__ignoreMap":16},[540,553,565,585,617,680,739,746,753],{"type":32,"tag":79,"props":541,"children":542},{"class":81,"line":82},[543,548],{"type":32,"tag":79,"props":544,"children":545},{"style":97},[546],{"type":37,"value":547},"nitro",{"type":32,"tag":79,"props":549,"children":550},{"style":103},[551],{"type":37,"value":552},": {\n",{"type":32,"tag":79,"props":554,"children":555},{"class":81,"line":109},[556,561],{"type":32,"tag":79,"props":557,"children":558},{"style":97},[559],{"type":37,"value":560},"  prerender",{"type":32,"tag":79,"props":562,"children":563},{"style":103},[564],{"type":37,"value":552},{"type":32,"tag":79,"props":566,"children":567},{"class":81,"line":118},[568,573,577,581],{"type":32,"tag":79,"props":569,"children":570},{"style":97},[571],{"type":37,"value":572},"    crawlLinks",{"type":32,"tag":79,"props":574,"children":575},{"style":103},[576],{"type":37,"value":197},{"type":32,"tag":79,"props":578,"children":579},{"style":133},[580],{"type":37,"value":226},{"type":32,"tag":79,"props":582,"children":583},{"style":103},[584],{"type":37,"value":415},{"type":32,"tag":79,"props":586,"children":587},{"class":81,"line":144},[588,593,597,602,607,612],{"type":32,"tag":79,"props":589,"children":590},{"style":97},[591],{"type":37,"value":592},"    routes",{"type":32,"tag":79,"props":594,"children":595},{"style":103},[596],{"type":37,"value":197},{"type":32,"tag":79,"props":598,"children":599},{"style":86},[600],{"type":37,"value":601},"async",{"type":32,"tag":79,"props":603,"children":604},{"style":103},[605],{"type":37,"value":606}," () ",{"type":32,"tag":79,"props":608,"children":609},{"style":86},[610],{"type":37,"value":611},"=>",{"type":32,"tag":79,"props":613,"children":614},{"style":103},[615],{"type":37,"value":616}," {\n",{"type":32,"tag":79,"props":618,"children":619},{"class":81,"line":167},[620,625,630,636,640,645,650,655,660,665,670,675],{"type":32,"tag":79,"props":621,"children":622},{"style":86},[623],{"type":37,"value":624},"      const",{"type":32,"tag":79,"props":626,"children":627},{"style":103},[628],{"type":37,"value":629}," { ",{"type":32,"tag":79,"props":631,"children":633},{"style":632},"--shiki-default:#FFAB70",[634],{"type":37,"value":635},"data",{"type":32,"tag":79,"props":637,"children":638},{"style":103},[639],{"type":37,"value":197},{"type":32,"tag":79,"props":641,"children":642},{"style":133},[643],{"type":37,"value":644},"posts",{"type":32,"tag":79,"props":646,"children":647},{"style":103},[648],{"type":37,"value":649}," } ",{"type":32,"tag":79,"props":651,"children":652},{"style":86},[653],{"type":37,"value":654},"=",{"type":32,"tag":79,"props":656,"children":657},{"style":86},[658],{"type":37,"value":659}," await",{"type":32,"tag":79,"props":661,"children":662},{"style":97},[663],{"type":37,"value":664}," $fetch",{"type":32,"tag":79,"props":666,"children":667},{"style":103},[668],{"type":37,"value":669},"(",{"type":32,"tag":79,"props":671,"children":672},{"style":122},[673],{"type":37,"value":674},"'\u002Fapi\u002Fposts'",{"type":32,"tag":79,"props":676,"children":677},{"style":103},[678],{"type":37,"value":679},")\n",{"type":32,"tag":79,"props":681,"children":682},{"class":81,"line":210},[683,688,693,698,702,706,711,716,720,725,730,735],{"type":32,"tag":79,"props":684,"children":685},{"style":86},[686],{"type":37,"value":687},"      return",{"type":32,"tag":79,"props":689,"children":690},{"style":103},[691],{"type":37,"value":692}," posts.",{"type":32,"tag":79,"props":694,"children":695},{"style":97},[696],{"type":37,"value":697},"map",{"type":32,"tag":79,"props":699,"children":700},{"style":103},[701],{"type":37,"value":669},{"type":32,"tag":79,"props":703,"children":704},{"style":632},[705],{"type":37,"value":33},{"type":32,"tag":79,"props":707,"children":708},{"style":86},[709],{"type":37,"value":710}," =>",{"type":32,"tag":79,"props":712,"children":713},{"style":122},[714],{"type":37,"value":715}," `\u002Fblog\u002F${",{"type":32,"tag":79,"props":717,"children":718},{"style":103},[719],{"type":37,"value":33},{"type":32,"tag":79,"props":721,"children":722},{"style":122},[723],{"type":37,"value":724},".",{"type":32,"tag":79,"props":726,"children":727},{"style":103},[728],{"type":37,"value":729},"slug",{"type":32,"tag":79,"props":731,"children":732},{"style":122},[733],{"type":37,"value":734},"}`",{"type":32,"tag":79,"props":736,"children":737},{"style":103},[738],{"type":37,"value":679},{"type":32,"tag":79,"props":740,"children":741},{"class":81,"line":233},[742],{"type":32,"tag":79,"props":743,"children":744},{"style":103},[745],{"type":37,"value":478},{"type":32,"tag":79,"props":747,"children":748},{"class":81,"line":26},[749],{"type":32,"tag":79,"props":750,"children":751},{"style":103},[752],{"type":37,"value":262},{"type":32,"tag":79,"props":754,"children":755},{"class":81,"line":265},[756],{"type":32,"tag":79,"props":757,"children":758},{"style":103},[759],{"type":37,"value":760},"}\n",{"type":32,"tag":33,"props":762,"children":763},{},[764],{"type":37,"value":765},"Questo pattern consente il controllo del prerender basato su fetch. Estrai l'elenco delle route dal tuo CMS e genera solo quelle. Su un progetto di e-commerce headless con 8.000 pagine, questo approccio ha ridotto il tempo di build da 18 minuti a 4.5 minuti.",{"type":32,"tag":49,"props":767,"children":769},{"id":768},"bundle-splitting-e-code-elimination",[770],{"type":37,"value":771},"Bundle Splitting e Code Elimination",{"type":32,"tag":33,"props":773,"children":774},{},[775],{"type":37,"value":776},"Anche quando non si utilizza la modalità SSG, il bundle JavaScript contiene tutti i component. Con il code splitting a livello di route è possibile ottimizzare:",{"type":32,"tag":69,"props":778,"children":780},{"className":71,"code":779,"language":73,"meta":16,"style":16},"export default defineNuxtConfig({\n  experimental: {\n    payloadExtraction: true\n  },\n  router: {\n    options: {\n      hashMode: false,\n      scrollBehaviorType: 'smooth'\n    }\n  }\n})\n",[781],{"type":32,"tag":40,"props":782,"children":783},{"__ignoreMap":16},[784,803,811,824,832,840,848,864,877,884,892],{"type":32,"tag":79,"props":785,"children":786},{"class":81,"line":82},[787,791,795,799],{"type":32,"tag":79,"props":788,"children":789},{"style":86},[790],{"type":37,"value":89},{"type":32,"tag":79,"props":792,"children":793},{"style":86},[794],{"type":37,"value":94},{"type":32,"tag":79,"props":796,"children":797},{"style":97},[798],{"type":37,"value":100},{"type":32,"tag":79,"props":800,"children":801},{"style":103},[802],{"type":37,"value":106},{"type":32,"tag":79,"props":804,"children":805},{"class":81,"line":109},[806],{"type":32,"tag":79,"props":807,"children":808},{"style":103},[809],{"type":37,"value":810},"  experimental: {\n",{"type":32,"tag":79,"props":812,"children":813},{"class":81,"line":118},[814,819],{"type":32,"tag":79,"props":815,"children":816},{"style":103},[817],{"type":37,"value":818},"    payloadExtraction: ",{"type":32,"tag":79,"props":820,"children":821},{"style":133},[822],{"type":37,"value":823},"true\n",{"type":32,"tag":79,"props":825,"children":826},{"class":81,"line":144},[827],{"type":32,"tag":79,"props":828,"children":829},{"style":103},[830],{"type":37,"value":831},"  },\n",{"type":32,"tag":79,"props":833,"children":834},{"class":81,"line":167},[835],{"type":32,"tag":79,"props":836,"children":837},{"style":103},[838],{"type":37,"value":839},"  router: {\n",{"type":32,"tag":79,"props":841,"children":842},{"class":81,"line":210},[843],{"type":32,"tag":79,"props":844,"children":845},{"style":103},[846],{"type":37,"value":847},"    options: {\n",{"type":32,"tag":79,"props":849,"children":850},{"class":81,"line":233},[851,856,860],{"type":32,"tag":79,"props":852,"children":853},{"style":103},[854],{"type":37,"value":855},"      hashMode: ",{"type":32,"tag":79,"props":857,"children":858},{"style":133},[859],{"type":37,"value":226},{"type":32,"tag":79,"props":861,"children":862},{"style":103},[863],{"type":37,"value":415},{"type":32,"tag":79,"props":865,"children":866},{"class":81,"line":26},[867,872],{"type":32,"tag":79,"props":868,"children":869},{"style":103},[870],{"type":37,"value":871},"      scrollBehaviorType: ",{"type":32,"tag":79,"props":873,"children":874},{"style":122},[875],{"type":37,"value":876},"'smooth'\n",{"type":32,"tag":79,"props":878,"children":879},{"class":81,"line":265},[880],{"type":32,"tag":79,"props":881,"children":882},{"style":103},[883],{"type":37,"value":478},{"type":32,"tag":79,"props":885,"children":887},{"class":81,"line":886},10,[888],{"type":32,"tag":79,"props":889,"children":890},{"style":103},[891],{"type":37,"value":262},{"type":32,"tag":79,"props":893,"children":895},{"class":81,"line":894},11,[896],{"type":32,"tag":79,"props":897,"children":898},{"style":103},[899],{"type":37,"value":271},{"type":32,"tag":33,"props":901,"children":902},{},[903,904,910],{"type":37,"value":497},{"type":32,"tag":40,"props":905,"children":907},{"className":906},[],[908],{"type":37,"value":909},"payloadExtraction: true",{"type":37,"value":911}," estrae il payload dei dati delle pagine prerenderizzate in file JSON separati. In questo modo, durante le transizioni di pagina viene caricato solo il diff, riducendo il bundle di caricamento iniziale del 40%.",{"type":32,"tag":294,"props":913,"children":915},{"id":914},"tree-shaking-per-pulizia-del-codice-non-utilizzato",[916],{"type":37,"value":917},"Tree Shaking per Pulizia del Codice Non Utilizzato",{"type":32,"tag":33,"props":919,"children":920},{},[921,923,929],{"type":37,"value":922},"Nuxt 3 utilizza auto-import, ma questo può causare l'inclusione di component non utilizzati nel bundle. Con ",{"type":32,"tag":40,"props":924,"children":926},{"className":925},[],[927],{"type":37,"value":928},"components: { dirs: [] }",{"type":37,"value":930}," disattiva la scansione automatica e importa manualmente solo i component necessari:",{"type":32,"tag":69,"props":932,"children":934},{"className":71,"code":933,"language":73,"meta":16,"style":16},"export default defineNuxtConfig({\n  components: false,\n  imports: {\n    dirs: ['composables']\n  }\n})\n",[935],{"type":32,"tag":40,"props":936,"children":937},{"__ignoreMap":16},[938,957,973,981,998,1005],{"type":32,"tag":79,"props":939,"children":940},{"class":81,"line":82},[941,945,949,953],{"type":32,"tag":79,"props":942,"children":943},{"style":86},[944],{"type":37,"value":89},{"type":32,"tag":79,"props":946,"children":947},{"style":86},[948],{"type":37,"value":94},{"type":32,"tag":79,"props":950,"children":951},{"style":97},[952],{"type":37,"value":100},{"type":32,"tag":79,"props":954,"children":955},{"style":103},[956],{"type":37,"value":106},{"type":32,"tag":79,"props":958,"children":959},{"class":81,"line":109},[960,965,969],{"type":32,"tag":79,"props":961,"children":962},{"style":103},[963],{"type":37,"value":964},"  components: ",{"type":32,"tag":79,"props":966,"children":967},{"style":133},[968],{"type":37,"value":226},{"type":32,"tag":79,"props":970,"children":971},{"style":103},[972],{"type":37,"value":415},{"type":32,"tag":79,"props":974,"children":975},{"class":81,"line":118},[976],{"type":32,"tag":79,"props":977,"children":978},{"style":103},[979],{"type":37,"value":980},"  imports: {\n",{"type":32,"tag":79,"props":982,"children":983},{"class":81,"line":144},[984,989,994],{"type":32,"tag":79,"props":985,"children":986},{"style":103},[987],{"type":37,"value":988},"    dirs: [",{"type":32,"tag":79,"props":990,"children":991},{"style":122},[992],{"type":37,"value":993},"'composables'",{"type":32,"tag":79,"props":995,"children":996},{"style":103},[997],{"type":37,"value":470},{"type":32,"tag":79,"props":999,"children":1000},{"class":81,"line":167},[1001],{"type":32,"tag":79,"props":1002,"children":1003},{"style":103},[1004],{"type":37,"value":262},{"type":32,"tag":79,"props":1006,"children":1007},{"class":81,"line":210},[1008],{"type":32,"tag":79,"props":1009,"children":1010},{"style":103},[1011],{"type":37,"value":271},{"type":32,"tag":33,"props":1013,"children":1014},{},[1015,1017,1023],{"type":37,"value":1016},"Questo approccio radicale ha ridotto le dimensioni del bundle del 28% (da 340KB a 245KB gzip). Il compromesso: l'esperienza dello sviluppatore diminuisce poiché ogni component deve essere importato manualmente. Approccio ibrido: auto-importa i component nella cartella ",{"type":32,"tag":40,"props":1018,"children":1020},{"className":1019},[],[1021],{"type":37,"value":1022},"\u002Fcomponents\u002Fglobal",{"type":37,"value":1024},", gestisci manualmente gli altri.",{"type":32,"tag":49,"props":1026,"children":1028},{"id":1027},"strategie-di-hydration",[1029],{"type":37,"value":1030},"Strategie di Hydration",{"type":32,"tag":33,"props":1032,"children":1033},{},[1034,1036,1042],{"type":37,"value":1035},"Il costo maggiore dell'SSG è l'hydration — la creazione dell'istanza Vue lato client aggiunge 200-400ms di TBT (Total Blocking Time). L'impostazione ",{"type":32,"tag":40,"props":1037,"children":1039},{"className":1038},[],[1040],{"type":37,"value":1041},"ssr: false",{"type":37,"value":1043}," di Nuxt 3 la disattiva completamente, ma comporta perdita di SEO.",{"type":32,"tag":69,"props":1045,"children":1049},{"className":1046,"code":1047,"language":1048,"meta":16,"style":16},"language-vue shiki shiki-themes github-dark","\u003Ctemplate>\n  \u003Cdiv>\n    \u003CClientOnly>\n      \u003CHeavyInteractiveWidget \u002F>\n    \u003C\u002FClientOnly>\n    \u003CStaticContent \u002F>\n  \u003C\u002Fdiv>\n\u003C\u002Ftemplate>\n","vue",[1050],{"type":32,"tag":40,"props":1051,"children":1052},{"__ignoreMap":16},[1053,1072,1089,1106,1124,1140,1156,1172],{"type":32,"tag":79,"props":1054,"children":1055},{"class":81,"line":82},[1056,1061,1067],{"type":32,"tag":79,"props":1057,"children":1058},{"style":103},[1059],{"type":37,"value":1060},"\u003C",{"type":32,"tag":79,"props":1062,"children":1064},{"style":1063},"--shiki-default:#85E89D",[1065],{"type":37,"value":1066},"template",{"type":32,"tag":79,"props":1068,"children":1069},{"style":103},[1070],{"type":37,"value":1071},">\n",{"type":32,"tag":79,"props":1073,"children":1074},{"class":81,"line":109},[1075,1080,1085],{"type":32,"tag":79,"props":1076,"children":1077},{"style":103},[1078],{"type":37,"value":1079},"  \u003C",{"type":32,"tag":79,"props":1081,"children":1082},{"style":1063},[1083],{"type":37,"value":1084},"div",{"type":32,"tag":79,"props":1086,"children":1087},{"style":103},[1088],{"type":37,"value":1071},{"type":32,"tag":79,"props":1090,"children":1091},{"class":81,"line":118},[1092,1097,1102],{"type":32,"tag":79,"props":1093,"children":1094},{"style":103},[1095],{"type":37,"value":1096},"    \u003C",{"type":32,"tag":79,"props":1098,"children":1099},{"style":1063},[1100],{"type":37,"value":1101},"ClientOnly",{"type":32,"tag":79,"props":1103,"children":1104},{"style":103},[1105],{"type":37,"value":1071},{"type":32,"tag":79,"props":1107,"children":1108},{"class":81,"line":144},[1109,1114,1119],{"type":32,"tag":79,"props":1110,"children":1111},{"style":103},[1112],{"type":37,"value":1113},"      \u003C",{"type":32,"tag":79,"props":1115,"children":1116},{"style":1063},[1117],{"type":37,"value":1118},"HeavyInteractiveWidget",{"type":32,"tag":79,"props":1120,"children":1121},{"style":103},[1122],{"type":37,"value":1123}," \u002F>\n",{"type":32,"tag":79,"props":1125,"children":1126},{"class":81,"line":167},[1127,1132,1136],{"type":32,"tag":79,"props":1128,"children":1129},{"style":103},[1130],{"type":37,"value":1131},"    \u003C\u002F",{"type":32,"tag":79,"props":1133,"children":1134},{"style":1063},[1135],{"type":37,"value":1101},{"type":32,"tag":79,"props":1137,"children":1138},{"style":103},[1139],{"type":37,"value":1071},{"type":32,"tag":79,"props":1141,"children":1142},{"class":81,"line":210},[1143,1147,1152],{"type":32,"tag":79,"props":1144,"children":1145},{"style":103},[1146],{"type":37,"value":1096},{"type":32,"tag":79,"props":1148,"children":1149},{"style":1063},[1150],{"type":37,"value":1151},"StaticContent",{"type":32,"tag":79,"props":1153,"children":1154},{"style":103},[1155],{"type":37,"value":1123},{"type":32,"tag":79,"props":1157,"children":1158},{"class":81,"line":233},[1159,1164,1168],{"type":32,"tag":79,"props":1160,"children":1161},{"style":103},[1162],{"type":37,"value":1163},"  \u003C\u002F",{"type":32,"tag":79,"props":1165,"children":1166},{"style":1063},[1167],{"type":37,"value":1084},{"type":32,"tag":79,"props":1169,"children":1170},{"style":103},[1171],{"type":37,"value":1071},{"type":32,"tag":79,"props":1173,"children":1174},{"class":81,"line":26},[1175,1180,1184],{"type":32,"tag":79,"props":1176,"children":1177},{"style":103},[1178],{"type":37,"value":1179},"\u003C\u002F",{"type":32,"tag":79,"props":1181,"children":1182},{"style":1063},[1183],{"type":37,"value":1066},{"type":32,"tag":79,"props":1185,"children":1186},{"style":103},[1187],{"type":37,"value":1071},{"type":32,"tag":33,"props":1189,"children":1190},{},[1191,1193,1199],{"type":37,"value":1192},"Il component ",{"type":32,"tag":40,"props":1194,"children":1196},{"className":1195},[],[1197],{"type":37,"value":1198},"\u003CClientOnly>",{"type":37,"value":1200}," renderizza solo lato client la sezione che lo racchiude. Nell'HTML generato con SSG, questa sezione rimane come placeholder, e Vue la ignora durante l'hydration. Con questo pattern, su una landing page con dashboard analytics, abbiamo ridotto il TBT da 420ms a 180ms.",{"type":32,"tag":294,"props":1202,"children":1204},{"id":1203},"selective-hydration",[1205],{"type":37,"value":1206},"Selective Hydration",{"type":32,"tag":33,"props":1208,"children":1209},{},[1210,1212,1218],{"type":37,"value":1211},"Con Nuxt 3.8+, il component ",{"type":32,"tag":40,"props":1213,"children":1215},{"className":1214},[],[1216],{"type":37,"value":1217},"nuxt-island",{"type":37,"value":1219}," fornisce partial hydration:",{"type":32,"tag":69,"props":1221,"children":1223},{"className":1046,"code":1222,"language":1048,"meta":16,"style":16},"\u003Ctemplate>\n  \u003CNuxtIsland name=\"ProductCard\" :props=\"{ id: 123 }\" \u002F>\n\u003C\u002Ftemplate>\n",[1224],{"type":32,"tag":40,"props":1225,"children":1226},{"__ignoreMap":16},[1227,1242,1310],{"type":32,"tag":79,"props":1228,"children":1229},{"class":81,"line":82},[1230,1234,1238],{"type":32,"tag":79,"props":1231,"children":1232},{"style":103},[1233],{"type":37,"value":1060},{"type":32,"tag":79,"props":1235,"children":1236},{"style":1063},[1237],{"type":37,"value":1066},{"type":32,"tag":79,"props":1239,"children":1240},{"style":103},[1241],{"type":37,"value":1071},{"type":32,"tag":79,"props":1243,"children":1244},{"class":81,"line":109},[1245,1249,1254,1259,1263,1268,1273,1278,1282,1287,1292,1297,1302,1306],{"type":32,"tag":79,"props":1246,"children":1247},{"style":103},[1248],{"type":37,"value":1079},{"type":32,"tag":79,"props":1250,"children":1251},{"style":1063},[1252],{"type":37,"value":1253},"NuxtIsland",{"type":32,"tag":79,"props":1255,"children":1256},{"style":97},[1257],{"type":37,"value":1258}," name",{"type":32,"tag":79,"props":1260,"children":1261},{"style":103},[1262],{"type":37,"value":654},{"type":32,"tag":79,"props":1264,"children":1265},{"style":122},[1266],{"type":37,"value":1267},"\"ProductCard\"",{"type":32,"tag":79,"props":1269,"children":1270},{"style":103},[1271],{"type":37,"value":1272}," :",{"type":32,"tag":79,"props":1274,"children":1275},{"style":97},[1276],{"type":37,"value":1277},"props",{"type":32,"tag":79,"props":1279,"children":1280},{"style":103},[1281],{"type":37,"value":654},{"type":32,"tag":79,"props":1283,"children":1284},{"style":122},[1285],{"type":37,"value":1286},"\"",{"type":32,"tag":79,"props":1288,"children":1289},{"style":103},[1290],{"type":37,"value":1291},"{ id: ",{"type":32,"tag":79,"props":1293,"children":1294},{"style":133},[1295],{"type":37,"value":1296},"123",{"type":32,"tag":79,"props":1298,"children":1299},{"style":103},[1300],{"type":37,"value":1301}," }",{"type":32,"tag":79,"props":1303,"children":1304},{"style":122},[1305],{"type":37,"value":1286},{"type":32,"tag":79,"props":1307,"children":1308},{"style":103},[1309],{"type":37,"value":1123},{"type":32,"tag":79,"props":1311,"children":1312},{"class":81,"line":118},[1313,1317,1321],{"type":32,"tag":79,"props":1314,"children":1315},{"style":103},[1316],{"type":37,"value":1179},{"type":32,"tag":79,"props":1318,"children":1319},{"style":1063},[1320],{"type":37,"value":1066},{"type":32,"tag":79,"props":1322,"children":1323},{"style":103},[1324],{"type":37,"value":1071},{"type":32,"tag":33,"props":1326,"children":1327},{},[1328,1333],{"type":32,"tag":40,"props":1329,"children":1331},{"className":1330},[],[1332],{"type":37,"value":1253},{"type":37,"value":1334}," viene renderizzato lato server e inviato al client come HTML, con l'hydration che avviene solo per questo component. Il resto della pagina rimane statico. Su un sito di e-commerce, abbiamo spostato le schede prodotto come island, riducendo il costo di hydration del 64% (TBT da 380ms a 135ms).",{"type":32,"tag":49,"props":1336,"children":1338},{"id":1337},"ottimizzazione-delle-prestazioni-di-build",[1339],{"type":37,"value":1340},"Ottimizzazione delle Prestazioni di Build",{"type":32,"tag":33,"props":1342,"children":1343},{},[1344],{"type":37,"value":1345},"Quando la build SSG supera le 15.000+ pagine e i 20 minuti, la pipeline CI\u002FCD rimane in stato stale. Ci sono 3 modi per aumentare le prestazioni di build di Nuxt 3:",{"type":32,"tag":33,"props":1347,"children":1348},{},[1349],{"type":32,"tag":309,"props":1350,"children":1351},{},[1352],{"type":37,"value":1353},"1. Prerender Parallelo:",{"type":32,"tag":69,"props":1355,"children":1357},{"className":71,"code":1356,"language":73,"meta":16,"style":16},"nitro: {\n  prerender: {\n    concurrency: 20,\n    interval: 0\n  }\n}\n",[1358],{"type":32,"tag":40,"props":1359,"children":1360},{"__ignoreMap":16},[1361,1372,1383,1404,1421,1428],{"type":32,"tag":79,"props":1362,"children":1363},{"class":81,"line":82},[1364,1368],{"type":32,"tag":79,"props":1365,"children":1366},{"style":97},[1367],{"type":37,"value":547},{"type":32,"tag":79,"props":1369,"children":1370},{"style":103},[1371],{"type":37,"value":552},{"type":32,"tag":79,"props":1373,"children":1374},{"class":81,"line":109},[1375,1379],{"type":32,"tag":79,"props":1376,"children":1377},{"style":97},[1378],{"type":37,"value":560},{"type":32,"tag":79,"props":1380,"children":1381},{"style":103},[1382],{"type":37,"value":552},{"type":32,"tag":79,"props":1384,"children":1385},{"class":81,"line":118},[1386,1391,1395,1400],{"type":32,"tag":79,"props":1387,"children":1388},{"style":97},[1389],{"type":37,"value":1390},"    concurrency",{"type":32,"tag":79,"props":1392,"children":1393},{"style":103},[1394],{"type":37,"value":197},{"type":32,"tag":79,"props":1396,"children":1397},{"style":133},[1398],{"type":37,"value":1399},"20",{"type":32,"tag":79,"props":1401,"children":1402},{"style":103},[1403],{"type":37,"value":415},{"type":32,"tag":79,"props":1405,"children":1406},{"class":81,"line":144},[1407,1412,1416],{"type":32,"tag":79,"props":1408,"children":1409},{"style":97},[1410],{"type":37,"value":1411},"    interval",{"type":32,"tag":79,"props":1413,"children":1414},{"style":103},[1415],{"type":37,"value":197},{"type":32,"tag":79,"props":1417,"children":1418},{"style":133},[1419],{"type":37,"value":1420},"0\n",{"type":32,"tag":79,"props":1422,"children":1423},{"class":81,"line":167},[1424],{"type":32,"tag":79,"props":1425,"children":1426},{"style":103},[1427],{"type":37,"value":262},{"type":32,"tag":79,"props":1429,"children":1430},{"class":81,"line":210},[1431],{"type":32,"tag":79,"props":1432,"children":1433},{"style":103},[1434],{"type":37,"value":760},{"type":32,"tag":33,"props":1436,"children":1437},{},[1438,1444],{"type":32,"tag":40,"props":1439,"children":1441},{"className":1440},[],[1442],{"type":37,"value":1443},"concurrency: 20",{"type":37,"value":1445}," renderizza 20 route contemporaneamente. Tuttavia, esiste il rischio di memory leak — funziona senza problemi con 32GB di RAM, ma su server CI\u002FCD con 8GB potresti ricevere errori OOM (Out of Memory); esegui test sul tuo server production.",{"type":32,"tag":33,"props":1447,"children":1448},{},[1449],{"type":32,"tag":309,"props":1450,"children":1451},{},[1452],{"type":37,"value":1453},"2. Incremental Build (Sperimentale):",{"type":32,"tag":69,"props":1455,"children":1457},{"className":71,"code":1456,"language":73,"meta":16,"style":16},"experimental: {\n  buildCache: true\n}\n",[1458],{"type":32,"tag":40,"props":1459,"children":1460},{"__ignoreMap":16},[1461,1473,1489],{"type":32,"tag":79,"props":1462,"children":1463},{"class":81,"line":82},[1464,1469],{"type":32,"tag":79,"props":1465,"children":1466},{"style":97},[1467],{"type":37,"value":1468},"experimental",{"type":32,"tag":79,"props":1470,"children":1471},{"style":103},[1472],{"type":37,"value":552},{"type":32,"tag":79,"props":1474,"children":1475},{"class":81,"line":109},[1476,1481,1485],{"type":32,"tag":79,"props":1477,"children":1478},{"style":97},[1479],{"type":37,"value":1480},"  buildCache",{"type":32,"tag":79,"props":1482,"children":1483},{"style":103},[1484],{"type":37,"value":197},{"type":32,"tag":79,"props":1486,"children":1487},{"style":133},[1488],{"type":37,"value":823},{"type":32,"tag":79,"props":1490,"children":1491},{"class":81,"line":118},[1492],{"type":32,"tag":79,"props":1493,"children":1494},{"style":103},[1495],{"type":37,"value":760},{"type":32,"tag":33,"props":1497,"children":1498},{},[1499],{"type":37,"value":1500},"Legge le route non modificate dalla cache. Tuttavia, a partire da Nuxt 3.12 è ancora in beta — l'invalidazione della cache potrebbe funzionare in modo errato.",{"type":32,"tag":33,"props":1502,"children":1503},{},[1504,1509],{"type":32,"tag":309,"props":1505,"children":1506},{},[1507],{"type":37,"value":1508},"3. Route Chunking:",{"type":37,"value":1510},"\nDividi le route in batch ed esegui la build con job paralleli:",{"type":32,"tag":69,"props":1512,"children":1516},{"className":1513,"code":1514,"language":1515,"meta":16,"style":16},"language-bash shiki shiki-themes github-dark","# Pipeline CI\u002FCD\nnuxt build --prerender-routes=\"\u002F,\u002Fabout\"\nnuxt build --prerender-routes=\"\u002Fblog\u002F**\" --append\nnuxt build --prerender-routes=\"\u002Fproduct\u002F**\" --append\n","bash",[1517],{"type":32,"tag":40,"props":1518,"children":1519},{"__ignoreMap":16},[1520,1529,1552,1577],{"type":32,"tag":79,"props":1521,"children":1522},{"class":81,"line":82},[1523],{"type":32,"tag":79,"props":1524,"children":1526},{"style":1525},"--shiki-default:#6A737D",[1527],{"type":37,"value":1528},"# Pipeline CI\u002FCD\n",{"type":32,"tag":79,"props":1530,"children":1531},{"class":81,"line":109},[1532,1537,1542,1547],{"type":32,"tag":79,"props":1533,"children":1534},{"style":97},[1535],{"type":37,"value":1536},"nuxt",{"type":32,"tag":79,"props":1538,"children":1539},{"style":122},[1540],{"type":37,"value":1541}," build",{"type":32,"tag":79,"props":1543,"children":1544},{"style":133},[1545],{"type":37,"value":1546}," --prerender-routes=",{"type":32,"tag":79,"props":1548,"children":1549},{"style":122},[1550],{"type":37,"value":1551},"\"\u002F,\u002Fabout\"\n",{"type":32,"tag":79,"props":1553,"children":1554},{"class":81,"line":118},[1555,1559,1563,1567,1572],{"type":32,"tag":79,"props":1556,"children":1557},{"style":97},[1558],{"type":37,"value":1536},{"type":32,"tag":79,"props":1560,"children":1561},{"style":122},[1562],{"type":37,"value":1541},{"type":32,"tag":79,"props":1564,"children":1565},{"style":133},[1566],{"type":37,"value":1546},{"type":32,"tag":79,"props":1568,"children":1569},{"style":122},[1570],{"type":37,"value":1571},"\"\u002Fblog\u002F**\"",{"type":32,"tag":79,"props":1573,"children":1574},{"style":133},[1575],{"type":37,"value":1576}," --append\n",{"type":32,"tag":79,"props":1578,"children":1579},{"class":81,"line":144},[1580,1584,1588,1592,1597],{"type":32,"tag":79,"props":1581,"children":1582},{"style":97},[1583],{"type":37,"value":1536},{"type":32,"tag":79,"props":1585,"children":1586},{"style":122},[1587],{"type":37,"value":1541},{"type":32,"tag":79,"props":1589,"children":1590},{"style":133},[1591],{"type":37,"value":1546},{"type":32,"tag":79,"props":1593,"children":1594},{"style":122},[1595],{"type":37,"value":1596},"\"\u002Fproduct\u002F**\"",{"type":32,"tag":79,"props":1598,"children":1599},{"style":133},[1600],{"type":37,"value":1576},{"type":32,"tag":33,"props":1602,"children":1603},{},[1604],{"type":37,"value":1605},"Con questo approccio, abbiamo suddiviso la build di 18 minuti in 3 job paralleli, riducendo il tempo totale a 6.5 minuti.",{"type":32,"tag":49,"props":1607,"children":1609},{"id":1608},"considerazioni-per-edge-deployment",[1610],{"type":37,"value":1611},"Considerazioni per Edge Deployment",{"type":32,"tag":33,"props":1613,"children":1614},{},[1615],{"type":37,"value":1616},"Quando distribuisci l'SSG su Cloudflare Pages, Vercel Edge o Netlify, presta attenzione ai seguenti punti:",{"type":32,"tag":33,"props":1618,"children":1619},{},[1620,1625,1627,1633,1635,1641],{"type":32,"tag":309,"props":1621,"children":1622},{},[1623],{"type":37,"value":1624},"Cloudflare Pages:",{"type":37,"value":1626}," L'impostazione ",{"type":32,"tag":40,"props":1628,"children":1630},{"className":1629},[],[1631],{"type":37,"value":1632},"nitro.preset: 'cloudflare-pages'",{"type":37,"value":1634}," è obbligatoria. ISR non è supportato, solo SWR funziona. Il file ",{"type":32,"tag":40,"props":1636,"children":1638},{"className":1637},[],[1639],{"type":37,"value":1640},"_headers",{"type":37,"value":1642}," consente di configurare manualmente cache-control.",{"type":32,"tag":33,"props":1644,"children":1645},{},[1646,1651,1653,1659],{"type":32,"tag":309,"props":1647,"children":1648},{},[1649],{"type":37,"value":1650},"Vercel:",{"type":37,"value":1652}," ISR è supportato nativamente, ma ",{"type":32,"tag":40,"props":1654,"children":1656},{"className":1655},[],[1657],{"type":37,"value":1658},"vercel.json",{"type":37,"value":1660}," può sovrascrivere le route-rule — rischio di conflitto di config. Utilizza la config di Nuxt come single source of truth.",{"type":32,"tag":33,"props":1662,"children":1663},{},[1664,1669,1671,1677,1679,1684,1686,1692],{"type":32,"tag":309,"props":1665,"children":1666},{},[1667],{"type":37,"value":1668},"Netlify:",{"type":37,"value":1670}," I file ",{"type":32,"tag":40,"props":1672,"children":1674},{"className":1673},[],[1675],{"type":37,"value":1676},"_redirects",{"type":37,"value":1678}," e ",{"type":32,"tag":40,"props":1680,"children":1682},{"className":1681},[],[1683],{"type":37,"value":1640},{"type":37,"value":1685}," vengono generati automaticamente, ma SWR richiede configurazione manuale in ",{"type":32,"tag":40,"props":1687,"children":1689},{"className":1688},[],[1690],{"type":37,"value":1691},"netlify.toml",{"type":37,"value":724},{"type":32,"tag":33,"props":1694,"children":1695},{},[1696,1698,1707],{"type":37,"value":1697},"Nei progetti ",{"type":32,"tag":1699,"props":1700,"children":1704},"a",{"href":1701,"rel":1702},"https:\u002F\u002Fwww.roibase.com.tr\u002Fit\u002Fheadless",[1703],"nofollow",[1705],{"type":37,"value":1706},"Headless Commerce",{"type":37,"value":1708}," di Roibase, distribuiamo i storefront generati con Nuxt 3 SSG su Cloudflare Pages. Combinando edge caching + ISR, il TTFB (Time to First Byte) scende sotto i 40ms, con LCP (Largest Contentful Paint) intorno a 1.2s.",{"type":32,"tag":1710,"props":1711,"children":1712},"hr",{},[],{"type":32,"tag":33,"props":1714,"children":1715},{},[1716],{"type":37,"value":1717},"Utilizzare strategicamente Nuxt 3 SSG significa selezionare la giusta modalità di rendering per ogni route. Combinando prerender in fase di build, ISR on-demand e SWR è possibile ottimizzare sia i Core Web Vitals che ridurre i costi di build. Rivedi le tue strategie di hydration — ridurre il carico di JavaScript lato client rappresenta il 60% dei guadagni di prestazione.",{"type":32,"tag":1719,"props":1720,"children":1721},"style",{},[1722],{"type":37,"value":1723},"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":118,"depth":118,"links":1725},[1726,1729,1732,1735,1738,1739],{"id":51,"depth":109,"text":54,"children":1727},[1728],{"id":296,"depth":118,"text":299},{"id":348,"depth":109,"text":351,"children":1730},[1731],{"id":516,"depth":118,"text":519},{"id":768,"depth":109,"text":771,"children":1733},[1734],{"id":914,"depth":118,"text":917},{"id":1027,"depth":109,"text":1030,"children":1736},[1737],{"id":1203,"depth":118,"text":1206},{"id":1337,"depth":109,"text":1340},{"id":1608,"depth":109,"text":1611},"markdown","content:it:tech:strategie-prerender-nuxt-3-e-ottimizzazione-build.md","content","it\u002Ftech\u002Fstrategie-prerender-nuxt-3-e-ottimizzazione-build.md","it\u002Ftech\u002Fstrategie-prerender-nuxt-3-e-ottimizzazione-build","md",1785218703447]