Fix /static performance regression from Hugo 0.103.0

In `v0.103.0` we added support for `resources.PostProcess` for all file types, not just HTML. We had benchmarks that said we were fine in that department, but those did not consider the static file syncing.

This fixes that by:

* Making sure that the /static syncer always gets its own file system without any checks for the post process token.
* For dynamic files (e.g. rendered HTML files) we add an additional check to make sure that we skip binary files (e.g. images)

Fixes #10328
This commit is contained in:
Bjørn Erik Pedersen
2022-09-26 17:34:20 +02:00
parent d8aba18e05
commit 29ccb36069
6 changed files with 32 additions and 23 deletions

View File

@@ -67,7 +67,7 @@ type BaseFs struct {
// This usually maps to /my-project/public.
PublishFs afero.Fs
// The filesystem used for renderStaticToDisk.
// The filesystem used for static files.
PublishFsStatic afero.Fs
// A read-only filesystem starting from the project workDir.