]> git.maquefel.me Git - brevno-suite/hugo/commit
Fix some server/watch rebuild issues
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Fri, 31 Jan 2025 09:35:01 +0000 (10:35 +0100)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Sat, 1 Feb 2025 15:29:14 +0000 (16:29 +0100)
commitdb28695ff505f84aee69c72dcc9e192f674c86a1
treeab20b3140cda0315380744dfef2e3ff0638efdee
parent778f0d90024fa9ad6e436b99b333248074c7d5d8
Fix some server/watch rebuild issues

Two issues:

1. Fixe potential edit-loop in server/watch mode (see below)
2. Drain the cache eviction stack before we start calculating the change set. This should allow more fine grained rebuilds for bigger sites and/or in low memory situations.

The fix in 6c68142cc1338640e2bfe2add661a7b4d7bee6ab wasn't really fixing the complete problem.

In Hugo we have some steps that takes more time than others, one example being CSS building with TailwindCSS.

The symptom here is that sometimes when you:

1. Edit content or templates that does not trigger a CSS rebuild => Snappy rebuild.
2. Edit stylesheet or add a CSS class to template that triggers a CSS rebuild => relatively slow rebuild (expected)
3. Then back to content editing or template edits that should not trigger a CSS rebuild => relatively slow rebuild (not expected)

This commit fixes this by pulling the dynacache GC step up and merge it with the cache buster step.

Fixes #13316
cache/dynacache/dynacache.go
cache/dynacache/dynacache_test.go
hugolib/content_map_page.go
hugolib/hugo_sites_build.go
identity/identity.go
resources/resource_factories/bundler/bundler.go