Comment by mvanaltvorst
5 years ago
I'm curious, in what manner could this method speed up Next.js builds? That's all done locally, which negates the effect of HTTP range requests, right?
5 years ago
I'm curious, in what manner could this method speed up Next.js builds? That's all done locally, which negates the effect of HTTP range requests, right?
I'm guessing they mean rather than build a static Next site that generates 10k+ pages (or whatever large means in the given context), it instead creates one page that just queries the data from the client.
I have one Next static site that has about 20k pages and takes about 20 minutes to build and deploy. I think that's an acceptable build time. But I do know of other people around the net who have mentioned having sites with 20k-ish pages taking an hour+ to build. For them I could see the desire to try this sqlite trick.
You should write a post about this if you implement it. My humble suggestion for blog post title - 'Speed up your Next.js builds with this author's one weird trick! Vercel hates him!'
I generate my entire blog on nextjs from a sqlite data base already. https://lsmurray.com/blog/database-first-development
It’s got a ton of rough edges but the boilerplate is there to get a proof of concept pretty quickly
For really large sites Next.js already has Incremental Static Regeneration which is usually the right solution to fast [re]builds: https://www.smashingmagazine.com/2021/04/incremental-static-...
Its not the same because you have to rebuild all the pages if you change your data source. In this implementation you can upload a new data set and it will work.
Its just a different stack.
Generating 20k pages in 20mins is impressive, 16 pages a second on average.
In my experience, it can take a couple of minutes just to deploy 20 pages, but that could just be the overhead of Typescript and SASS compilation too...
Hugo claims <1ms a page. Which would mean 20k pages in under 20 seconds. 20k pages in 20 mins is not fast!
1 reply →
Oops, my memory was off. It's 10,925 pages and the last build took 18 minutes.