Need to do a hard reload in browser to see changes in localhost

Hugo experience level: novice

I’m making changes locally to my site while running the hugo server. It is detecting the changes and doing rebuilds. However, I have to use Ctrl+F5 to see the changes in the browser.

If I then do a normal refresh, it loads the old version again.

I’m running hugo v0.11.0 on a Windows 11 computer. I have the developer tools open and “disable cache” enabled.

Any ideas? Here’s the command line output

❯ hugo server --disableFastRender
Start building sites …
hugo v0.110.0-e32a493b7826d02763c3b79623952e625402b168+extended windows/amd64 BuildDate=2023-01-17T12:16:09Z VendorInfo=gohugoio

               | EN   

Pages | 29
Paginator pages | 0
Non-page files | 0
Static files | 131
Processed images | 0
Aliases | 0
Sitemaps | 1
Cleaned | 0

Built in 130 ms
Watching for changes in …My Site{archetypes,assets,content,data,layouts,static,themes}
Watching for config changes in …My Site\config.toml
Environment: “development”
Serving pages from memory
Web Server is available at http://localhost:1313/ (bind address
Press Ctrl+C to stop

Change detected, rebuilding site.
2023-02-11 19:35:12.794 +1100
Source changed WRITE “…My Site\content\contact\”
Total in 22 ms

that’s how browsers behave sometimes. What is not refreshing correctly exactly?

If its style, add fingerprinting to your CSS if the CSS is cached

{{ $style := resources.Get "css/style.css" | minify | fingerprint }}
  <link rel="stylesheet" type="text/css" href="{{ $style.Permalink }}" media='all' fetchpriority="highest">

I’m changing the text content on a page so I don’t think fingerprinting helps here. I’ve changed the front matter, the body, partials. I’ve tested with Chrome and Edge and I see the same behaviour.

Sometimes, some specific changes, like some front matter will require hugo to be re-run, in other instances you just need to look into adjusting your browser toyour needs. Incognito/privacy window or disabling coach as you already figured out.

For example, changing the weight of a page in the front matter requires a Hugo restart if the menu is ordered by weight. Or at least it did here with the book theme. YMMV.