On this page, you'll find some important points on how to prepare and build your application. And on the following pages, you'll read guides explaining how to deploy your site on platforms like Vercel, Cloudflare, and Netlify.
Building
To build your app just hit build, like this:
This way, your app will be built statically - fast, performant, and ready to be deployed anywhere you like. However, since we don't know your final deployment destination, the process is designed to be a bit more flexible. It's also worth mentioning that the Boilerplate application you may start with does not have any predefined deployment setup.
Each deployment platform requires some additional settings, such as dedicated folder structures or configuration files. To address this, please check the guide for your desired deployment platform on the following pages.
Behind the scenes
DocLayer performs a number of additional actions designed to improve your application's speed, performance, safety, and readability. Below, we've highlighted a few of these actions so you can easily recognize the immediate benefits.
Static generation
DocLayer is designed as a content-focused application - ideal for documentation, specs, guides, blogs, and similar projects. It does not require advanced user interactions or dynamic data fetching, making it a perfect candidate for static site generation. This approach results in a fast and performant application.
Static builds can be efficiently cached on a CDN, minimizing hosting costs. For projects that require dynamic functionality or serverless actions, dedicated adapters are available to handle those needs.
This is the initial prerender setup for the Nitro server:
With crawling enabled, the renderer will automatically generate a static version of every internal link it finds in your app. However, if a page isn't linked anywhere, Nitro will not generate a static file for it.
Similarly, images will only be optimized if they appear in your content; if not, they will simply be copied from their original location without optimization.
Additionally, since we use some internal development API endpoints, all of these will be excluded from your final build, as they are not needed in production. Adapter server handlers will be added automatically as needed by the dedicated module.
Performance
To improve performance, and decrease the final build size we've used some additional techniques to make it possible. These are:
- CSS compression: We use
@nuxtjs/critters, which extracts and inlines critical CSS, reducing the size of bundled.cssfiles. This is especially important for minimizing the size of Tailwind's prebuilt utility styles. - Static compression: In your final build
.htmlfiles will be compressed withgzipand delivered alongside the original files. Thanks to this, the server will automatically pick up the appropriate version and deliver it as quickly as possible, reducing load time since the compressed files are much smaller than the originals. It's important to note that these compressed files served by the server are cached by default, so modifying them at runtime will not have any effect. - Predefined CDN caching: Since DocLayer builds to a static application, almost all data will be aggressively cached at the edge, which means your application content may not update instantly everywhere. If a CDN is not available or configured, the system will fall back to in-memory caching, all managed by Nitro.
- Application-based caching: Components like
DlRenderer,DlLink, andDlCodeutilize internal caching strategies to minimize unnecessary data recalculations during both build time and runtime. Content data fetched for pages and navigation is also cached. While the current system is efficient, there is still significant potential for further improvements, which we plan to introduce in future updates. - Image optimization: By default, Nuxt Image Module handles image optimization using the built-in IPX provider. You can always switch your setup or use a different provider depending on your deployment platform. On some platforms, such as Vercel, optimization works automatically - no extra configuration is needed.
Test performance with CDN
It's important to note that given the nature of this application, you should not rely on local performance testing. The best and most accurate results can only be achieved with a well-cached application on a CDN.

Of course, you can follow suggestions from tools like Lighthouse, but make sure to test only within the server context. The large number of variables that can influence the final results locally may not accurately reflect the true performance of your deployed app.
