You certainly can, although very large applications with a lot of pages are often better to be rendered on the server side in my opinion. But a Reddit-like JAMStack implementation would probably not be too difficult. You would write a few page layouts: subreddit, post, user settings, etc., then pull in the data to be inserted in these layouts from a serverless backend. This is why JAMStack is so flexible because ideally your content is completely decoupled from its presentation layer.
Then, it should rebuild every time an user submits a new post? I guess that you could somehow do it incrementally, but wouldn't it be a huge bottleneck? Thanks!
No, you can still use fetch calls and other dynamic client-side code from a JAMStack app, so you don't rebuild. But this is why I say large applications are better rendered server-side though—you really shouldn't have a static site or SPA that is trying to act like a really dynamic application with a ton of client-side fetch calls.
You certainly can, although very large applications with a lot of pages are often better to be rendered on the server side in my opinion. But a Reddit-like JAMStack implementation would probably not be too difficult. You would write a few page layouts: subreddit, post, user settings, etc., then pull in the data to be inserted in these layouts from a serverless backend. This is why JAMStack is so flexible because ideally your content is completely decoupled from its presentation layer.
Then, it should rebuild every time an user submits a new post? I guess that you could somehow do it incrementally, but wouldn't it be a huge bottleneck? Thanks!
No, you can still use
fetch
calls and other dynamic client-side code from a JAMStack app, so you don't rebuild. But this is why I say large applications are better rendered server-side though—you really shouldn't have a static site or SPA that is trying to act like a really dynamic application with a ton of client-side fetch calls.That posts wouldn't get SEO and basically all the benefits of being static are also lost. I get it now, thanks!