How to improve Nuxt3 generate speed?

I’m working on a project https://itoolkit.co which uses Vue3 + Nuxt3. The product currently has over 100 web-based tools in 9 languages, resulting in over 1000 pages. Generating static pages takes over 10 minutes currently. My computer specs are adequate and I’ve done some optimizations:

  1. Added nitro config in nuxt.config.ts to increase concurrency:
nitro: { 
    prerender: {
         concurrency: 12,
   },
 },
  1. Increased memory when generating
node --max_old_space_size=8192 ./node_modules/.bin/nuxt generate --dotenv .env.en
  1. Increased ulimit for open files.

My main questions:

  1. As the number of pages increases, generate gets slower and consumes more resources. Any tips for optimization?
  2. I’m familiar with Vue and need SEO-friendly pages with CDN deploy. That’s why I chose Nuxt. Are there other frameworks I could consider? I looked at Gridsome - would it have better performance for my use case?

Hi,

I don’t think that another framework will necessarily improve performance for you at the build stage, although Gridsome is a good choice.

If you have minification enabled, you can try turning that off during the build phase with Nuxt. This was a popular option in Nuxt v2 with big sites numbering thousands of pages, not entirely sure if it’s still there in Nuxt 3 though.

You can try hosting your build process in the cloud, for example Amazon Web Services CodeBuild. From there you can select a custom deployment option. This will be especially easy if you can generate an entirely static site.

Gridsome is a good choice if you don’t mind doing a bit of migration work!

Thanks for the reply. I haven’t tried minification before. I found this approach online but didn’t try it because I need to minify js and html. From my build process I noticed crawl takes most of the time.

I can try Gridsome. Time is not my biggest concern, I’m more worried that as the number of pages grows, the memory needed increases and my computer can’t finish the build anymore. This would be fatal.

Without setting up a server there’s not much you can do I’m afraid. If you have a server you can look into Incremental Static Generation (ISG).

Yes, I don’t have a server which is a cost consideration. My project itoolkit aims to provide browser-based tools so I can serve people without cost concerns. I know there are many online tools but they are scattered with too many ads. I don’t want ads but also don’t want to lose money, so minimizing costs is a sensible choice.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.