Join our community

Get access to the complete guide to developing and deploying fast, production-ready Nuxt apps.

7-2 Static Generation and Pre-Rendering

In this lesson, we look at how we can use pre-rendering and static generation to make our app faster.

Our course landing page doesn’t change very often, so there’s no need to re-render it for every single request. Instead, we can make it faster by prerendering the page at build time.

By using the generate we can get Nuxt to prerender every single route of app into a static file, so we don’t need to run a JS server at all. But since our course platform is dynamic, it breaks the app.

Instead, we can configure Nitro to prerender only our landing page, building the rest of our app as normal.

Nuxi generate: https://nuxt.com/docs/api/commands/generate

Nitro prerender config: https://nitro.unjs.io/config#prerender