Hugo rebuild does not update public folder

I have the same kind of problem problem as Hugo server not refreshing with content change - #5 by billthefarmer but not exactly.

All was working fine until seemingly without any reason my local site stopped updating when I’d modify anything (content or template).

In console changes are detected:

Change detected, rebuilding site (#1).
2024-12-19 14:33:07.943 +0100
Template changed /_default/summary.html
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Total in 45 ms

But public folder is not updated according to the “last modified” column of my OS.

If I start Hugo with the --disableFastRender flag, public does get updated, but the web page isn’t automatically refreshed, I must hit F5 to see the changes, which isn’t the usual behavior either.

I started and stopped server multiple times with no effect.

  • hugo version: v0.140.0-3f35721fb2c75a1f7cc5a7a14400b66e73d4b06e+extended linux/amd64 BuildDate=2024-12-17T14:20:55Z VendorInfo=snap:0.140.0
  • Ubuntu 24.04
  • Theme ananke

This is called browser/HTTP caching.

You can do either:

  1. Run with the developer console open and the “disable cache” option enabled in Chrome.
  2. Run with hugo server --noHTTPCache

Same behavior with noHTTPCache (and I use Firefox). This makes sense because this behavior occurred at the same time as my original problem, and until then the auto-refresh was working fine in the basic config.

When you create, update, or delete directory descendants, the modification date of the directory itself does not change. That’s how the file system works.

I just tested the rebuild/refresh behavior by starting with this:

hugo new site foo
cd foo
git init
git submodule add https://github.com/theNewDynamic/gohugo-theme-ananke.git themes/ananke
echo "theme = 'ananke'" >> hugo.toml
hugo server

Then I added and updated content. Everything updates/refreshes as expected with both Chrome and Firefox.

Maybe there’s something here that’s applicable to your setup:
https://gohugo.io/troubleshooting/faq/#why-isnt-hugos-development-server-detecting-file-changes

I tested with:

hugo v0.140.0-3f35721fb2c75a1f7cc5a7a14400b66e73d4b06e+extended linux/amd64 BuildDate=2024-12-17T14:20:55Z VendorInfo=snap:0.140.0