[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"$KiqIp5Qu8t":3,"blog-\u002Fblog\u002Fimplementing-esr-nuxt":52,"blogToc-\u002Fblog\u002Fimplementing-esr-nuxt":406,"blog-surrounding-\u002Fblog\u002Fimplementing-esr-nuxt":611,"blog-similar-posts-\u002Fblog\u002Fimplementing-esr-nuxt":620},{"id":4,"extension":5,"items":6,"meta":49,"stem":50,"__hash__":51},"menu\u002Fmenu.json","json",[7,12,16,20,24,28,32,36,41,45],{"i18nId":8,"to":9,"ariaLabel":10,"mainNavigation":11},"components.menu.home","\u002F","Home",true,{"i18nId":13,"to":14,"ariaLabel":15,"mainNavigation":11},"components.menu.about","\u002Fhire-me","About",{"i18nId":17,"to":18,"ariaLabel":19,"mainNavigation":11},"components.menu.testimonials","\u002Ftestimonials","Testimonials",{"i18nId":21,"to":22,"ariaLabel":23},"components.menu.contact","\u002Fcontact","Contact",{"i18nId":25,"to":26,"ariaLabel":27,"mainNavigation":11},"components.menu.blog","\u002Fblog","Blog",{"i18nId":29,"to":30,"ariaLabel":31,"mainNavigation":11},"components.menu.tips","\u002Fvue-tips","Vue Tips",{"i18nId":33,"to":34,"ariaLabel":35,"mainNavigation":11},"components.menu.projects","\u002Fprojects","Projects",{"i18nId":37,"to":38,"ariaLabel":39,"mainNavigation":40},"components.menu.stats","\u002Fstats","stats",false,{"i18nId":42,"to":43,"ariaLabel":44,"mainNavigation":40},"components.menu.businessCard","\u002Fbusiness-card","Business Card",{"i18nId":46,"to":47,"ariaLabel":48,"mainNavigation":40},"components.menu.publications","\u002Fpublications","Publications",{},"menu","njLT1QoRt2Dv8QWoVmH8xdTAiDywSj0bxBQdmoyWUE0",{"id":53,"title":54,"body":55,"categories":386,"cover":390,"date":391,"description":392,"extension":393,"lastUpdated":394,"meta":395,"navigation":11,"ogImage":394,"path":396,"readingTime":397,"robots":394,"schemaOrg":394,"seo":402,"sitemap":403,"stem":404,"tags":394,"__hash__":405},"blog\u002Fblog\u002Fimplementing-esr-nuxt.md","Edge-Side Rendering in Nuxt: Deployment and Trade-Offs",{"type":56,"value":57,"toc":377},"minimark",[58,62,65,70,73,89,92,96,99,102,105,109,130,133,165,174,181,192,210,214,225,228,299,302,314,317,331,335,338,341,344,348,351,354,363,367,370,373],[59,60,61],"p",{},"A server-rendered Nuxt page needs a server to generate its HTML. If that server is far from the visitor, the request has further to travel. Edge-side rendering moves that work to a server location closer to the visitor.",[59,63,64],{},"In this article, I want to explain what changes when you render a Nuxt application at the edge, how Nitro's deployment presets fit in and which limitations to check before moving an app.",[66,67,69],"h2",{"id":68},"what-is-edge-side-rendering","What Is Edge-Side Rendering?",[59,71,72],{},"With server-side rendering, Nuxt generates HTML for an incoming request. Edge-side rendering uses the same idea, but runs the server code across a provider's distributed locations instead of a single region.",[59,74,75,82,83,88],{},[76,77,81],"a",{"href":78,"rel":79},"https:\u002F\u002Fnuxt.com\u002Fdocs\u002Fguide\u002Fconcepts\u002Frendering\u002F",[80],"nofollow","Nuxt's rendering documentation"," explains the rendering modes. ",[76,84,87],{"href":85,"rel":86},"https:\u002F\u002Fnitro.build\u002F",[80],"Nitro"," builds the server part of a Nuxt application for the chosen deployment target.",[59,90,91],{},"Serving static assets from a CDN doesn't mean the application uses edge-side rendering. A CDN can serve JavaScript, images and cached HTML while the server that generates new responses remains in one region. The difference is where the code for a dynamic request runs.",[66,93,95],{"id":94},"when-does-it-help","When Does It Help?",[59,97,98],{},"Rendering near the visitor can reduce the network time between the browser and the application server. It is worth considering for an application with visitors spread across several regions.",[59,100,101],{},"But the application server often needs other services. If every page request queries a database in Frankfurt, moving the rendering to a location near a visitor in Australia still leaves the database request travelling to Frankfurt. Several sequential database queries can make that distance more noticeable.",[59,103,104],{},"I would look at the full request before choosing a deployment target: browser to server, server to database and any external API calls. Moving only the renderer doesn't guarantee a faster page.",[66,106,108],{"id":107},"deploying-with-cloudflare-pages","Deploying With Cloudflare Pages",[59,110,111,116,117,121,122,125,126,129],{},[76,112,115],{"href":113,"rel":114},"https:\u002F\u002Fpages.cloudflare.com\u002F",[80],"Cloudflare Pages"," can run Nuxt's server code through its Functions integration. For an existing Pages project, connect a supported Git repository and use ",[118,119,120],"code",{},"pnpm build"," as the build command when that script runs ",[118,123,124],{},"nuxt build",". Use ",[118,127,128],{},"dist"," as the build output directory for the Pages preset.",[59,131,132],{},"Nuxt can detect the Pages build environment and choose the preset automatically. For a local build targeting Pages explicitly, use:",[134,135,140],"pre",{"className":136,"code":137,"language":138,"meta":139,"style":139},"language-bash shiki shiki-themes github-light poimandres poimandres","pnpm exec nuxt build --preset=cloudflare_pages\n","bash","",[118,141,142],{"__ignoreMap":139},[143,144,147,151,155,158,161],"span",{"class":145,"line":146},"line",1,[143,148,150],{"class":149},"sgaD9","pnpm",[143,152,154],{"class":153},"sMmyg"," exec",[143,156,157],{"class":153}," nuxt",[143,159,160],{"class":153}," build",[143,162,164],{"class":163},"snkik"," --preset=cloudflare_pages\n",[59,166,167,168,173],{},"This creates the Pages deployment output, including the server entry for dynamic requests. Follow the ",[76,169,172],{"href":170,"rel":171},"https:\u002F\u002Fnuxt.com\u002Fdeploy\u002Fcloudflare",[80],"Nuxt Cloudflare deployment guide"," for uploading that output or setting up the Git integration. Running the build locally doesn't deploy the app.",[59,175,176,177,180],{},"Use a server build if you need request-time rendering. ",[118,178,179],{},"nuxt generate"," produces prerendered pages, which is a different deployment even though both can serve content through Cloudflare's network.",[182,183,184],"note",{},[59,185,186,191],{},[76,187,190],{"href":188,"rel":189},"https:\u002F\u002Fhub.nuxt.com\u002F",[80],"NuxtHub"," offers database, storage and cache integrations for Nuxt. Check which services and deployment targets your NuxtHub version supports; those integrations are separate from the rendering mode.",[193,194,195],"tip",{},[59,196,197,198,203,204,209],{},"My ",[76,199,202],{"href":200,"rel":201},"https:\u002F\u002Fnuxtstarterkit.com",[80],"Nuxt Starter Kit"," uses NuxtHub and components from ",[76,205,208],{"href":206,"rel":207},"https:\u002F\u002Fui.nuxt.com\u002Fpro?aff=z1NAy",[80],"Nuxt UI Pro",". Check the kit's deployment requirements before choosing a runtime for your project.",[66,211,213],{"id":212},"vercel-and-netlify-presets","Vercel and Netlify Presets",[59,215,216,217,220,221,224],{},"Nitro presets describe the output needed by a hosting platform. In the Nitro version used with Nuxt 3, the edge presets include ",[118,218,219],{},"vercel-edge"," and ",[118,222,223],{},"netlify-edge",".",[59,226,227],{},"For example, a Nuxt 3 project targeting Netlify Edge Functions can declare its preset in the config:",[134,229,234],{"className":230,"code":231,"filename":232,"language":233,"meta":139,"style":139},"language-ts shiki shiki-themes github-light poimandres poimandres","export default defineNuxtConfig({\n  nitro: {\n    preset: 'netlify-edge',\n  },\n})\n","nuxt.config.ts","ts",[118,235,236,253,266,287,293],{"__ignoreMap":139},[143,237,238,242,245,249],{"class":145,"line":146},[143,239,241],{"class":240},"sRZEA","export",[143,243,244],{"class":240}," default",[143,246,248],{"class":247},"sHQ3f"," defineNuxtConfig",[143,250,252],{"class":251},"sygvE","({\n",[143,254,256,260,263],{"class":145,"line":255},2,[143,257,259],{"class":258},"srga6","  nitro",[143,261,262],{"class":251},":",[143,264,265],{"class":251}," {\n",[143,267,269,272,274,278,281,284],{"class":145,"line":268},3,[143,270,271],{"class":258},"    preset",[143,273,262],{"class":251},[143,275,277],{"class":276},"srEIG"," '",[143,279,223],{"class":280},"skTdI",[143,282,283],{"class":276},"'",[143,285,286],{"class":251},",\n",[143,288,290],{"class":145,"line":289},4,[143,291,292],{"class":251},"  },\n",[143,294,296],{"class":145,"line":295},5,[143,297,298],{"class":251},"})\n",[59,300,301],{},"Then build the app and deploy it using Netlify's deployment workflow:",[134,303,305],{"className":136,"code":304,"language":138,"meta":139,"style":139},"pnpm build\n",[118,306,307],{"__ignoreMap":139},[143,308,309,311],{"class":145,"line":146},[143,310,150],{"class":149},[143,312,313],{"class":153}," build\n",[59,315,316],{},"Selecting a preset changes the server bundle. It doesn't create the hosting project, configure secrets or check whether every dependency works in that runtime. Verify those separately.",[59,318,319,320,220,325,330],{},"Check the guides for ",[76,321,324],{"href":322,"rel":323},"https:\u002F\u002Fnuxt.com\u002Fdeploy\u002Fvercel",[80],"Vercel",[76,326,329],{"href":327,"rel":328},"https:\u002F\u002Fnuxt.com\u002Fdeploy\u002Fnetlify",[80],"Netlify"," against your installed Nuxt and Nitro versions. Preset names and platform recommendations can change, and a provider's default server deployment isn't necessarily an edge deployment. I would follow the provider's current recommendation when setting up a new app rather than copy an old preset unchanged.",[66,332,334],{"id":333},"check-runtime-compatibility","Check Runtime Compatibility",[59,336,337],{},"An edge runtime may not provide the same APIs as a Node.js server. A package that reads local files, loads a native module or opens a database connection can need a different implementation. Available compatibility features depend on the provider and runtime configuration.",[59,339,340],{},"Start by checking your server dependencies. A successful build is useful, but also exercise the routes that use authentication, storage, email or a database in a deployed preview. Those requests can fail even when a basic page renders correctly.",[59,342,343],{},"Environment variables and secrets also need to be configured on the platform. Keep them in server-only runtime configuration and verify that the deployed app receives them.",[66,345,347],{"id":346},"measure-before-and-after-moving","Measure Before and After Moving",[59,349,350],{},"I wouldn't use a fixed cold-start number to decide whether an app belongs at the edge. Runtime startup, application code, cache state and external requests all affect the result. A small example from a framework benchmark doesn't tell us how a database-backed page will behave.",[59,352,353],{},"Compare the same routes from the regions your visitors use. Measure time to first byte and the time spent waiting for data. Test both cached and uncached requests, and check errors as well as successful responses.",[59,355,356,357,362],{},"Caching can remove more work than changing the server location. Public content may be suitable for prerendering or a shared cache. Personalized pages need different cache rules so one visitor's response isn't served to another. The ",[76,358,361],{"href":359,"rel":360},"https:\u002F\u002Fnuxt.com\u002Fblog\u002Fnuxt-on-the-edge",[80],"Nuxt on the Edge article"," provides background on Nitro's approach, but deployment decisions still need measurements from your app.",[66,364,366],{"id":365},"conclusion","Conclusion",[59,368,369],{},"I would consider edge-side rendering when the application can answer requests near its visitors without repeatedly calling a distant database. For an app tied to one database region, I would first compare it with running the server near that database.",[59,371,372],{},"Nitro makes building for different targets possible, but it doesn't remove runtime restrictions or network distance between services. I would choose the target after checking those dependencies and measuring representative requests.",[374,375,376],"style",{},"html pre.shiki code .sgaD9, html code.shiki .sgaD9{--shiki-light:#6F42C1;--shiki-default:#91B4D5;--shiki-dark:#91B4D5}html pre.shiki code .sMmyg, html code.shiki .sMmyg{--shiki-light:#032F62;--shiki-default:#ADD7FF;--shiki-dark:#ADD7FF}html pre.shiki code .snkik, html code.shiki .snkik{--shiki-light:#005CC5;--shiki-default:#ADD7FF;--shiki-dark:#ADD7FF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sRZEA, html code.shiki .sRZEA{--shiki-light:#D73A49;--shiki-default:#5DE4C7;--shiki-dark:#5DE4C7}html pre.shiki code .sHQ3f, html code.shiki .sHQ3f{--shiki-light:#6F42C1;--shiki-default:#E4F0FBD0;--shiki-dark:#E4F0FBD0}html pre.shiki code .sygvE, html code.shiki .sygvE{--shiki-light:#24292E;--shiki-default:#A6ACCD;--shiki-dark:#A6ACCD}html pre.shiki code .srga6, html code.shiki .srga6{--shiki-light:#24292E;--shiki-default:#ADD7FF;--shiki-dark:#ADD7FF}html pre.shiki code .srEIG, html code.shiki .srEIG{--shiki-light:#032F62;--shiki-default:#A6ACCD;--shiki-dark:#A6ACCD}html pre.shiki code .skTdI, html code.shiki .skTdI{--shiki-light:#032F62;--shiki-default:#5DE4C7;--shiki-dark:#5DE4C7}",{"title":139,"searchDepth":255,"depth":255,"links":378},[379,380,381,382,383,384,385],{"id":68,"depth":255,"text":69},{"id":94,"depth":255,"text":95},{"id":107,"depth":255,"text":108},{"id":212,"depth":255,"text":213},{"id":333,"depth":255,"text":334},{"id":346,"depth":255,"text":347},{"id":365,"depth":255,"text":366},[387,388,389],"development","frontend","nuxt-js","blog\u002Fimplementing-esr-nuxt\u002Fog.png","2025-06-06","How edge-side rendering works in Nuxt, how Nitro presets target hosting platforms, and why database location and runtime compatibility matter.","md",null,{},"\u002Fblog\u002Fimplementing-esr-nuxt",{"text":398,"minutes":399,"time":400,"words":401},"5 min read",4.505,270300,901,{"title":54,"description":392},{"loc":396,"lastmod":391},"blog\u002Fimplementing-esr-nuxt","51Y0h9KmxVx6_s9_diMZaZHs_uA8IqVLoKgQskPbmGQ",{"id":407,"title":54,"body":408,"cover":390,"description":392,"extension":393,"meta":605,"navigation":11,"path":396,"robots":394,"seo":608,"sitemap":609,"stem":404,"__hash__":610},"content\u002Fblog\u002Fimplementing-esr-nuxt.md",{"type":56,"value":409,"toc":596},[410,412,414,416,418,426,428,430,432,434,436,438,449,451,467,472,476,483,493,495,501,503,547,549,559,561,569,571,573,575,577,579,581,583,588,590,592,594],[59,411,61],{},[59,413,64],{},[66,415,69],{"id":68},[59,417,72],{},[59,419,420,82,423,88],{},[76,421,81],{"href":78,"rel":422},[80],[76,424,87],{"href":85,"rel":425},[80],[59,427,91],{},[66,429,95],{"id":94},[59,431,98],{},[59,433,101],{},[59,435,104],{},[66,437,108],{"id":107},[59,439,440,116,443,121,445,125,447,129],{},[76,441,115],{"href":113,"rel":442},[80],[118,444,120],{},[118,446,124],{},[118,448,128],{},[59,450,132],{},[134,452,453],{"className":136,"code":137,"language":138,"meta":139,"style":139},[118,454,455],{"__ignoreMap":139},[143,456,457,459,461,463,465],{"class":145,"line":146},[143,458,150],{"class":149},[143,460,154],{"class":153},[143,462,157],{"class":153},[143,464,160],{"class":153},[143,466,164],{"class":163},[59,468,167,469,173],{},[76,470,172],{"href":170,"rel":471},[80],[59,473,176,474,180],{},[118,475,179],{},[182,477,478],{},[59,479,480,191],{},[76,481,190],{"href":188,"rel":482},[80],[193,484,485],{},[59,486,197,487,203,490,209],{},[76,488,202],{"href":200,"rel":489},[80],[76,491,208],{"href":206,"rel":492},[80],[66,494,213],{"id":212},[59,496,216,497,220,499,224],{},[118,498,219],{},[118,500,223],{},[59,502,227],{},[134,504,505],{"className":230,"code":231,"filename":232,"language":233,"meta":139,"style":139},[118,506,507,517,525,539,543],{"__ignoreMap":139},[143,508,509,511,513,515],{"class":145,"line":146},[143,510,241],{"class":240},[143,512,244],{"class":240},[143,514,248],{"class":247},[143,516,252],{"class":251},[143,518,519,521,523],{"class":145,"line":255},[143,520,259],{"class":258},[143,522,262],{"class":251},[143,524,265],{"class":251},[143,526,527,529,531,533,535,537],{"class":145,"line":268},[143,528,271],{"class":258},[143,530,262],{"class":251},[143,532,277],{"class":276},[143,534,223],{"class":280},[143,536,283],{"class":276},[143,538,286],{"class":251},[143,540,541],{"class":145,"line":289},[143,542,292],{"class":251},[143,544,545],{"class":145,"line":295},[143,546,298],{"class":251},[59,548,301],{},[134,550,551],{"className":136,"code":304,"language":138,"meta":139,"style":139},[118,552,553],{"__ignoreMap":139},[143,554,555,557],{"class":145,"line":146},[143,556,150],{"class":149},[143,558,313],{"class":153},[59,560,316],{},[59,562,319,563,220,566,330],{},[76,564,324],{"href":322,"rel":565},[80],[76,567,329],{"href":327,"rel":568},[80],[66,570,334],{"id":333},[59,572,337],{},[59,574,340],{},[59,576,343],{},[66,578,347],{"id":346},[59,580,350],{},[59,582,353],{},[59,584,356,585,362],{},[76,586,361],{"href":359,"rel":587},[80],[66,589,366],{"id":365},[59,591,369],{},[59,593,372],{},[374,595,376],{},{"title":139,"searchDepth":255,"depth":255,"links":597},[598,599,600,601,602,603,604],{"id":68,"depth":255,"text":69},{"id":94,"depth":255,"text":95},{"id":107,"depth":255,"text":108},{"id":212,"depth":255,"text":213},{"id":333,"depth":255,"text":334},{"id":346,"depth":255,"text":347},{"id":365,"depth":255,"text":366},{"categories":606,"date":391,"readingTime":607},[387,388,389],{"text":398,"minutes":399,"time":400,"words":401},{"title":54,"description":392},{"loc":396,"lastmod":391},"ScBJ2JXG1GSujypB7nuDMR8YLve3rYJQXk2UGQmgWd8",[612,616],{"title":613,"path":614,"stem":615,"children":-1},"Vercel Acquires NuxtLabs: What This Means for the Future of Nuxt","\u002Fblog\u002Fvercel-acquires-nuxtlabs","blog\u002Fvercel-acquires-nuxtlabs\u002Findex",{"title":617,"path":618,"stem":619,"children":-1},"Why I Developed My Own Nuxt Starter Kit for SaaS Products","\u002Fblog\u002Fwhy-i-developed-my-own-nuxt-starter-kit","blog\u002Fwhy-i-developed-my-own-nuxt-starter-kit\u002Findex",[621,626,631,636],{"cover":622,"date":623,"slug":624,"title":625,"to":624},"blog\u002Fa-comprehensive-guide-to-data-fetching-in-nuxt-3\u002Fog.png","2023-06-20","\u002Fblog\u002Fa-comprehensive-guide-to-data-fetching-in-nuxt-3","A Comprehensive Guide to Data Fetching in Nuxt 3",{"cover":627,"date":628,"slug":629,"title":630,"to":629},"blog\u002Fanalyze-memory-leaks-in-your-nuxt-app\u002Fog.png","2024-07-27","\u002Fblog\u002Fanalyze-memory-leaks-in-your-nuxt-app","Analyze Memory Leaks in Your Nuxt App",{"cover":632,"date":633,"slug":634,"title":635,"to":634},"blog\u002Fbuilding-a-polite-newsletter-popup-with-nuxt-3\u002FBlog_Post__Polite_Popup_Nuxt_3_k8ch1w.jpg","2022-10-18","\u002Fblog\u002Fbuilding-a-polite-newsletter-popup-with-nuxt-3","Building a Polite Newsletter Popup With Nuxt 3",{"cover":637,"date":638,"slug":639,"title":640,"to":639},"blog\u002Fconnecting-mysql-database-nuxt-drizzle-orm\u002Fog.jpg","2025-08-22","\u002Fblog\u002Fconnecting-mysql-database-nuxt-drizzle-orm","Connecting a MySQL Database in Nuxt with Drizzle ORM"]