mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-25 22:00:58 +02:00
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:
@@ -40,8 +40,7 @@ type Fs struct {
|
||||
// It's mounted inside publishDir (default /public).
|
||||
PublishDir afero.Fs
|
||||
|
||||
// PublishDirStatic is the file system used for static files when --renderStaticToDisk is set.
|
||||
// When this is set, PublishDir is set to write to memory.
|
||||
// PublishDirStatic is the file system used for static files.
|
||||
PublishDirStatic afero.Fs
|
||||
|
||||
// PublishDirServer is the file system used for serving the public directory with Hugo's development server.
|
||||
@@ -142,7 +141,6 @@ func isWrite(flag int) bool {
|
||||
// MakeReadableAndRemoveAllModulePkgDir makes any subdir in dir readable and then
|
||||
// removes the root.
|
||||
// TODO(bep) move this to a more suitable place.
|
||||
//
|
||||
func MakeReadableAndRemoveAllModulePkgDir(fs afero.Fs, dir string) (int, error) {
|
||||
// Safe guard
|
||||
if !strings.Contains(dir, "pkg") {
|
||||
|
Reference in New Issue
Block a user