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
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.
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.