Gatsby: [suggestion] Optimizing the build process

Created on 24 Apr 2018  路  2Comments  路  Source: gatsbyjs/gatsby

Description

When my site had more than 100 posts, Gatsby takes about two minutes to build static pages.

It doesn't matter, I don't care much about the build time. But I noticed that after executing the gatsby build command, it would delete the contents of the public folder before starting to build static pages.

My nginx was hosting the public folder, which resulted in my site being offline for two minutes during the build process.

I think it should build static pages in the .cache/pre-public folder before copying them to public to avoid interruption of web services.

Of course, I can solve this problem in other ways, but if Gatsby is willing to solve this logic problem, it's better ~ LOL

question or discussion

Most helpful comment

Gatsby doesn't expect to be building in your web root. We suggest building the site in a different directory and copying the files over to nginx once each build finishes.

All 2 comments

Forget it. I use PWA to solve.

Gatsby doesn't expect to be building in your web root. We suggest building the site in a different directory and copying the files over to nginx once each build finishes.

Was this page helpful?
0 / 5 - 0 ratings