Do Segments work with Hugo server?

I have a particularly large site that I am porting from WordPress and it is resource heavy. If I understand correctly, segments can render a smaller section of the site? I want to create templates and styles using one small section for preview without exhausting my PC.

Yes, segments work with hugo server.

I still see huge spikes in RAM/CPU with it, so I feel like “Faster builds” means time to build and not reduced resource usage?

It especially becomes a nightmare with the watcher on repeated builds. I have to cancel some builds to prevent my computer from freezing.

--renderSegments means that we will only render the pages matching the segment(s) definitions. So, if you have 100K pages and only render 5K of those, you save a lot of IO and other resource usage. But since you can navigate the entire object graph from any template, we do need a complete view (but there’s a lot of lazy initialization, for e.g. .Content), so I guess the resource savings you get depends a little, but it’s not unsubstantial.

1 Like

That said, for development purposes, my may also try to create a developer only config where you mount only part of your content.

1 Like

I was actually thinking about stripping down some content from each section into a workable site. But I am intrigued by this idea. Do you have an example?

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.