Let's talk a little more about where this kind of falls apart though, right? This doesn't always scale. I've heard this over the years from people on GitHub, on Twitter, etc. That it's great for your blog, or for a tiny site, but it doesn't scale for really large sites. What if you have a lot of pages and so on? I disagree. We'll talk about why.
Let's say you want to build an e-commerce site, right? You start out with what looks like a template from Tailwind UI, which I bought, by the way. And you have a homepage with your products and so on, and you have about 20-30-odd products and it builds quickly and it's all great. And you have another page where you have a t-shirt that you sell and it's all wonderful. Your whole site builds in under a minute. Life's good. But then, you have a lot more products, right? Over time, you make money, you sell more t-shirts or mugs or whatever you're selling. And now, suddenly, this happens. You see that time stamp there? That's an hour and 54 minutes. I didn't make that up. That's a screenshot. Julian works with me, that's a screenshot. A site took an hour and 54 minutes to build. That's kind of unusable, no? I mean, you can't possibly wait two hours after every change you make. And this is real. We've seen this. We've had customers who have seen this. And this is one of the reasons why SSG sort of falls apart, it can get slow, because you want to do all of that work at build time, and maybe that's too much work. So how do you fix this? Well, in our e-commerce site that we're trying to build, what you typically do is, you know, you'd get frustrated, and you say, hey, this doesn't scale, and you'd call an old friend. Next. Or really anything that does SSR.
And the way SSR works is that, well, we've done this over the years, you have some server, whether it's Node.js, PHP, whatever, that serves every request, right, and you have a cache in front of it. It works well, it's served us for years, but now you've lost all the benefits and everything that SSG promised you, everything that you sort of wanted to go static for in the first place. Cache is much harder to predict, it's not deterministic. Cache tends to be user specific, sometimes even edge specific, right. It's hard to know what is cached at what point in time for your site, for all your users.
Comments