Hacker News new | ask | show | jobs
by tomduncalf 2079 days ago
Yeah, SSG build times are certainly an issue in my experience, even for smallish sites. I quite like the incremental regeneration idea in NextJS: https://nextjs.org/blog/next-9-5#stable-incremental-static-r... - sounds like it will rerender pages in the background as traffic comes in to them, while serving a stale version to the original request. I guess there are times when this might not be acceptable though... in which case really you just want to be able to rerender the subset of pages a given change affects, but this isn’t always easy to work out.
2 comments

It’s kinda funny to see that go around in circles. “Pre-rendering content as requests come in” is exactly the same as having dynamic pages and a layer of caching, as had been standard practice for the last 20 years. Some people just really like to “solve” already solved problems.
In principle, the two are very similar. However, the way we implement it is similar to database replication. Once a static page is produced, we can store it for usage across the entire edge network. This means you get the benefits of traditional static generation too: less backend load, higher availability, lower latency.
Haha, that’s true. I guess the advantage to NextJS is it comes “batteries included” - you don’t have to worry about setting up a cache etc. Obviously for some use cases setting it up yourself will make more sense
As they say, "Get a framework that'll do both."
This totally depends on the SSG. Hugo can generate thousands of pages in a couple of seconds.