[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"nav-notes-count":3,"content-note-a-practical-performance-review-for-a-nuxt-site":4},9,{"id":5,"title":6,"author":7,"authorAvatar":8,"authorRole":9,"body":10,"category":596,"date":597,"description":148,"excerpt":598,"extension":599,"image":600,"index":601,"meta":602,"navigation":222,"path":616,"pullQuote":617,"readingTime":618,"seo":619,"slug":620,"stem":621,"takeaways":622,"total":626,"__hash__":627},"notes\u002Fnotes\u002Fa-practical-performance-review-for-a-nuxt-site.md","A Practical Performance Review for a Nuxt Site","Norbert Brett","\u002Fimages\u002Fnorbert-brett.jpg","Full-Stack & AI Systems Engineer",{"type":11,"value":12,"toc":585},"minimark",[13,18,32,102,116,123,127,135,142,372,376,386,444,451,458,462,574,581],[14,15,17],"h2",{"id":16},"why-a-single-lighthouse-score-never-tells-the-whole-story","Why a Single Lighthouse Score Never Tells the Whole Story",[19,20,21,22,26,27,31],"p",{},"Business owners and developers love sharing screenshots of four green ",[23,24,25],"code",{},"100"," circles from Google Lighthouse. Don't get me wrong—this portfolio maintains a ",[28,29,30],"strong",{},"98+ Lighthouse performance score",", and automated speed checks are a great baseline. But if you have ever visited a website that loaded its top banner in one second and then stuttered or lagged every time you scrolled down or clicked a price toggle, you have experienced what a single Lighthouse number misses.",[33,34,35,40],"blockquote",{},[19,36,37],{},[28,38,39],{},"In Plain English — Web Speed Jargon Decoded:",[41,42,43,50,72,84],"ul",{},[44,45,46,49],"li",{},[28,47,48],{},"Lighthouse",": Google's automated lab test that grades a web page from 0 to 100 on speed, accessibility, and SEO. Think of it like checking how fast a restaurant's front door opens—useful, but it stops measuring before you sit down and order.",[44,51,52,59,60,64,65,67,68,71],{},[28,53,54,55,58],{},"SSR (Server-Side Rendering) & Hydration (",[23,56,57],{},"__NUXT_DATA__",")",": To make your page show up immediately on phones and in Google search, the server sends a finished HTML page first (",[61,62,63],"em",{},"SSR","), along with a hidden data packet (",[23,66,57],{},") that wakes up the interactive buttons in the browser (",[61,69,70],{},"Hydration","). If that hidden packet is stuffed with unused data, every visitor downloads a heavy invisible backpack.",[44,73,74,77,78,83],{},[28,75,76],{},"CLS (Cumulative Layout Shift)",": That annoying jump when you are about to tap a button on your phone and a slow-loading font or image pushes the text down by half an inch. Our target is ",[28,79,80],{},[23,81,82],{},"0.00",".",[44,85,86,89,90,93,94,97,98,101],{},[28,87,88],{},"INP (Interaction to Next Paint)",": How many milliseconds pass between tapping a button (like switching ",[23,91,92],{},"HUF"," to ",[23,95,96],{},"EUR",") and seeing the screen update. Anything under ",[23,99,100],{},"50ms"," feels instantaneous to the human eye.",[19,103,104,105,108,109,112,113,115],{},"Months earlier, while reviewing a Nuxt application built in 2025 that boasted a ",[23,106,107],{},"96"," Lighthouse score, I was annoyed to discover why mobile users complained it felt sluggish: the homepage was embedding ",[23,110,111],{},"480 KB"," of unused blog text inside its hidden ",[23,114,57],{}," script tag and forcing the browser to recalculate the height of every card sixty times a second during scroll.",[19,117,118],{},[119,120],"img",{"alt":121,"src":122},"Nuxt 4 Performance Audit Architecture","\u002Fimages\u002Fnotes\u002Fdiagrams\u002Fa-practical-performance-review-for-a-nuxt-site.svg",[14,124,126],{"id":125},"the-four-bottlenecks-i-check-first-in-a-nuxt-4-audit","The Four Bottlenecks I Check First in a Nuxt 4 Audit",[128,129,131,132,134],"h3",{"id":130},"_1-trim-the-hidden-__nuxt_data__-hydration-payload","1. Trim the Hidden ",[23,133,57],{}," Hydration Payload",[19,136,137,138,141],{},"When a homepage or blog index fetches articles on the server, a common mistake is loading the ",[61,139,140],{},"entire"," collection—including 1,500-word article bodies—just to show three preview cards with a title, date, and one-sentence summary. By selecting only the summary fields needed for the card view, we cut the initial HTML payload size by over 75%:",[143,144,149],"pre",{"className":145,"code":146,"language":147,"meta":148,"style":148},"language-ts shiki shiki-themes github-light github-dark","\u002F\u002F Bad: Embeds the full text of every article into the index page's hidden HTML data\nconst { data } = await useAsyncData('notes', () => queryCollection('notes').all())\n\n\u002F\u002F Good: Only sends the lightweight card fields needed for the index view\nconst { data } = await useAsyncData('feed-notes', async () => {\n  const rows = await queryCollection('notes').all()\n  return rows.map(({ slug, title, category, date, readingTime, image, excerpt, index }) => ({\n    slug, title, category, date, readingTime, image, excerpt, index,\n  }))\n})\n","ts","",[23,150,151,160,217,224,230,266,293,355,361,366],{"__ignoreMap":148},[152,153,156],"span",{"class":154,"line":155},"line",1,[152,157,159],{"class":158},"sJ8bj","\u002F\u002F Bad: Embeds the full text of every article into the index page's hidden HTML data\n",[152,161,163,167,171,175,178,181,184,188,191,195,198,201,204,206,208,211,214],{"class":154,"line":162},2,[152,164,166],{"class":165},"szBVR","const",[152,168,170],{"class":169},"sVt8B"," { ",[152,172,174],{"class":173},"sj4cs","data",[152,176,177],{"class":169}," } ",[152,179,180],{"class":165},"=",[152,182,183],{"class":165}," await",[152,185,187],{"class":186},"sScJk"," useAsyncData",[152,189,190],{"class":169},"(",[152,192,194],{"class":193},"sZZnC","'notes'",[152,196,197],{"class":169},", () ",[152,199,200],{"class":165},"=>",[152,202,203],{"class":186}," queryCollection",[152,205,190],{"class":169},[152,207,194],{"class":193},[152,209,210],{"class":169},").",[152,212,213],{"class":186},"all",[152,215,216],{"class":169},"())\n",[152,218,220],{"class":154,"line":219},3,[152,221,223],{"emptyLinePlaceholder":222},true,"\n",[152,225,227],{"class":154,"line":226},4,[152,228,229],{"class":158},"\u002F\u002F Good: Only sends the lightweight card fields needed for the index view\n",[152,231,233,235,237,239,241,243,245,247,249,252,255,258,261,263],{"class":154,"line":232},5,[152,234,166],{"class":165},[152,236,170],{"class":169},[152,238,174],{"class":173},[152,240,177],{"class":169},[152,242,180],{"class":165},[152,244,183],{"class":165},[152,246,187],{"class":186},[152,248,190],{"class":169},[152,250,251],{"class":193},"'feed-notes'",[152,253,254],{"class":169},", ",[152,256,257],{"class":165},"async",[152,259,260],{"class":169}," () ",[152,262,200],{"class":165},[152,264,265],{"class":169}," {\n",[152,267,269,272,275,278,280,282,284,286,288,290],{"class":154,"line":268},6,[152,270,271],{"class":165},"  const",[152,273,274],{"class":173}," rows",[152,276,277],{"class":165}," =",[152,279,183],{"class":165},[152,281,203],{"class":186},[152,283,190],{"class":169},[152,285,194],{"class":193},[152,287,210],{"class":169},[152,289,213],{"class":186},[152,291,292],{"class":169},"()\n",[152,294,296,299,302,305,308,312,314,317,319,322,324,327,329,332,334,337,339,342,344,347,350,352],{"class":154,"line":295},7,[152,297,298],{"class":165},"  return",[152,300,301],{"class":169}," rows.",[152,303,304],{"class":186},"map",[152,306,307],{"class":169},"(({ ",[152,309,311],{"class":310},"s4XuR","slug",[152,313,254],{"class":169},[152,315,316],{"class":310},"title",[152,318,254],{"class":169},[152,320,321],{"class":310},"category",[152,323,254],{"class":169},[152,325,326],{"class":310},"date",[152,328,254],{"class":169},[152,330,331],{"class":310},"readingTime",[152,333,254],{"class":169},[152,335,336],{"class":310},"image",[152,338,254],{"class":169},[152,340,341],{"class":310},"excerpt",[152,343,254],{"class":169},[152,345,346],{"class":310},"index",[152,348,349],{"class":169}," }) ",[152,351,200],{"class":165},[152,353,354],{"class":169}," ({\n",[152,356,358],{"class":154,"line":357},8,[152,359,360],{"class":169},"    slug, title, category, date, readingTime, image, excerpt, index,\n",[152,362,363],{"class":154,"line":3},[152,364,365],{"class":169},"  }))\n",[152,367,369],{"class":154,"line":368},10,[152,370,371],{"class":169},"})\n",[128,373,375],{"id":374},"_2-keep-scroll-listeners-passive-and-animations-on-the-gpu","2. Keep Scroll Listeners Passive and Animations on the GPU",[19,377,378,379,254,382,385],{},"Across ",[23,380,381],{},"AppNavbar.vue",[23,383,384],{},"ProcessSection.vue",", and our homepage scroll animations, scrolling drives visual feedback. Two strict rules prevent scroll lag:",[41,387,388,403],{},[44,389,390,393,394,399,400],{},[28,391,392],{},"Mark scroll listeners"," ",[28,395,396],{},[23,397,398],{},"{ passive: true }",": This tells the browser ",[61,401,402],{},"\"Go ahead and scroll the screen immediately—you never have to wait for my JavaScript code to finish first.\"",[44,404,405,393,408,393,413,393,416,421,422,425,426,429,430,254,433,436,437,440,441,210],{},[28,406,407],{},"Animate only",[28,409,410],{},[23,411,412],{},"transform: translate3d(...)",[28,414,415],{},"and",[28,417,418],{},[23,419,420],{},"opacity",": Moving elements with ",[23,423,424],{},"translate3d"," runs directly on the device's graphics chip (GPU) in under ",[23,427,428],{},"8ms"," per frame, whereas animating ",[23,431,432],{},"top",[23,434,435],{},"height",", or ",[23,438,439],{},"margin"," forces the CPU to re-measure the whole page on every pixel (",[23,442,443],{},"layout thrashing",[128,445,447,448,58],{"id":446},"_3-lock-font-metrics-so-text-never-jumps-cls-000","3. Lock Font Metrics so Text Never Jumps (",[23,449,450],{},"CLS = 0.00",[19,452,453,454,457],{},"Custom fonts give a brand character, but loading them carelessly causes text to reflow half a second after the page appears. By preconnecting to the font server in ",[23,455,456],{},"nuxt.config.ts"," and matching fallback font sizing, text stays locked in place from the first millisecond.",[128,459,461],{"id":460},"_4-measure-before-and-after-under-real-throttling","4. Measure Before and After Under Real Throttling",[463,464,465,481],"table",{},[466,467,468],"thead",{},[469,470,471,475,478],"tr",{},[472,473,474],"th",{},"Bottleneck Checked",[472,476,477],{},"How We Measure It",[472,479,480],{},"Our Production Target",[482,483,484,505,531,556],"tbody",{},[469,485,486,494,497],{},[487,488,489],"td",{},[28,490,491,492,58],{},"Hidden HTML Data (",[23,493,57],{},[487,495,496],{},"Inspect initial HTML document size in Chrome DevTools Network tab",[487,498,499,504],{},[28,500,501],{},[23,502,503],{},"\u003C 35 KB"," compressed on index pages",[469,506,507,512,519],{},[487,508,509],{},[28,510,511],{},"Scroll Smoothness",[487,513,514,515,518],{},"Chrome DevTools Performance trace with ",[23,516,517],{},"4x CPU Slowdown"," enabled",[487,520,521,526,527,530],{},[28,522,523],{},[23,524,525],{},"\u003C 10 ms \u002F frame"," (",[23,528,529],{},"60 FPS",", zero red long-task bars)",[469,532,533,541,548],{},[487,534,535],{},[28,536,537,538,58],{},"Button Response Time (",[23,539,540],{},"INP",[487,542,543,544,547],{},"Tap theme, language (",[23,545,546],{},"EN\u002FHU","), and filter buttons under CPU throttling",[487,549,550,555],{},[28,551,552],{},[23,553,554],{},"\u003C 50 ms"," (4x faster than Google's 200ms threshold)",[469,557,558,563,566],{},[487,559,560],{},[28,561,562],{},"Third-Party Tracker Tax",[487,564,565],{},"Audit external network requests on page load",[487,567,568,573],{},[28,569,570],{},[23,571,572],{},"0 KB"," of ad trackers or bloated popup scripts",[19,575,576,577,580],{},"I felt relieved after running our final production build (",[23,578,579],{},"pnpm build",") and 4x CPU-throttled scroll trace on this site: zero third-party tracking bloat, instant page transitions, and a browser thread that rests at 0% CPU the moment your finger stops scrolling.",[582,583,584],"style",{},"html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":148,"searchDepth":162,"depth":162,"links":586},[587,588],{"id":16,"depth":162,"text":17},{"id":125,"depth":162,"text":126,"children":589},[590,592,593,595],{"id":130,"depth":219,"text":591},"1. Trim the Hidden __NUXT_DATA__ Hydration Payload",{"id":374,"depth":219,"text":375},{"id":446,"depth":219,"text":594},"3. Lock Font Metrics so Text Never Jumps (CLS = 0.00)",{"id":460,"depth":219,"text":461},"Motion Architecture","October 9, 2026",null,"md","\u002Fimages\u002Fnotes\u002Fa-practical-performance-review-for-a-nuxt-site.webp","09",{"sections":603},[604,610],{"marker":605,"heading":606,"body":607},"\u002F A","Why a Single Synthetic Lighthouse Score Lies",[608,609],"Lighthouse runs a cold load test over a simulated throttling profile and stops measuring right before the user actually interacts with the page. You can score 99 on initial load and still ship a sluggish site with 300ms Interaction to Next Paint (INP) spikes.","When profiling a Nuxt 4 site, I inspect four concrete budgets first: the serialized __NUXT_DATA__ SSR payload size, main-thread frame timing during scroll, webfont metric overrides, and image decoding overhead.",{"marker":611,"heading":612,"body":613},"\u002F B","Fixing the Real Bottlenecks and Verifying the Delta",[614,615],"Trimming unused fields before useAsyncData serialization, marking scroll and pointer listeners passive, and restricting animations to compositor-only translate3d and opacity properties keep frame times under 8ms.","Every optimization is checked against Chrome DevTools Performance traces and automated build output sizes before shipping.","\u002Fnotes\u002Fa-practical-performance-review-for-a-nuxt-site","A 100 Lighthouse score on an empty landing page means nothing if your interactive showcase drops to 22fps the moment a user scrolls on a mid-range laptop.","7 min read",{"title":6,"description":148},"a-practical-performance-review-for-a-nuxt-site","notes\u002Fa-practical-performance-review-for-a-nuxt-site",[623,624,625],"A high Lighthouse score only measures how fast the page opens; you also have to test how smoothly it scrolls and responds to clicks.","Trim unused fields from Nuxt server queries so you don't hide 500 KB of invisible JSON data inside the initial HTML download.","Use passive scroll listeners, GPU-friendly transforms (translate3d), and zero third-party ad trackers to keep every interaction under 50ms.","10","fGHt-w1frbygpP8mJHStHy9l_ANqgqKnGBbUZbqqZMY"]