Build time went from instant to a few seconds with Hugo Modules

This in spite of setting the go.mod file with a replace rule. Instead of going for, the theme is in my hard disk.

I can still work with this, but the great speed it’s gone. :anguished:

I guess it has to do with the checking up the github online repo every time. I don’t know for sure (not a go programmer).

I even tried with a _vendor folder, and still the same result.

Have some of you notice this too? Is anything I can do to improve this?

Regards (from México)

Did you tried templateMetrics, to be sure that there is nothing new/changed in your code that can cause this ?

Not if you use the replace order.
Not if you do not change the cache delay for modules.
Not if you use hugo mod vendor

My experience with Hugo modules in this area have been very good. There is a module cache which makes it in general very fast (I just tested now with some of my module backed sites, and all of them built in < 100 ms). Not sure what happens in your situation, but that is hard to debug remotely.

Even if there is some startup penalty, you should not see that in server reloads.

Thanks for your replies. I will look into it. Something else must be wrong then. Bye

1 Like

What you can look after is if you see log lines that looks like hugo: Downloading modules ... which is an indicator of remote work being done, which should not be needed for every build (because it’s cached).