No on demand rendering?

I’m using a headless CMS with around 200k posts.

Can hugo be used purely as a frontend, where it fetches data from my backend API and renders it dynamically?

For example: if someone visits /post/{slug}, it would call the backend API, get the post data, and then render the UI.

From what I understand, hugo mainly generates static sites. But with 200k posts, that would mean pre-rendering everything, and rebuilding the whole site every time there’s new content — which feels so 1994’s way of deploying a website.

How to achieve my use case so I can host it on static only hosting like netlify?

The short answer to your question is no. You could possibly segmentise your site and only build newer content every hour or so, but that gets a little tricky on a service like Netlify.

As to your 1994 remark; you are right, but there are many reasons that the 1994 way of doing it still the right way. It’s not for all, but for many. For one, the cyber crime scene has evolved a lot since 94 and it’s hard to attack HTML files stored on a disk, i.e. no API’s and database to inject stuff into.

2 Likes