-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hugo server command shall synchronize pages resources, not always overwrite #7957
Labels
Milestone
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In my website, I have a lot of "static" resources for my pages: video, pdf files, images.... The resources are stored with the page they belong to, in the same directory, in the
content
section. This seems a good practice and allow using Hugo image processing.However, when I launch
hugo server
, withrenderToDisk
parameter, all the resources are copied on thedestinationDir
, overwriting what may already exist at this place, even if it's already "up to date".This is a big problem as it slows a lot server launching when you have like 1GB of resources files. The server launch time jumps to 45 seconds, when it's like 5 seconds without uselessly copying this files. SSD disk may not like this unnecessary write job every time server is launched. And Hugo loose its "blazing fast" feature.
As a test, I moved all my resources files to the
/static
directory, and build time dropped drastically when re-lauching the server (after the first launch). Because thehugo server
command cares about not copying static files that already exists indestinationDir
.Could you please add the same logic for "static" page resources: do not copy resources files to
destinationDir
if not needed (if there is already a file with same name and modified date in thedestinationDir
). This shall also apply to generated resources cached inresources/_gen
(tipically, resized images). They should not be copied todestinationDir
ifdestinationDir
is up to date with those files.Did not try, but I think the
hugo
command has the same problem.If it is needed to force update,
hugo server
has a--cleanDestinationDir
and a--forceSyncStatic
options wich would be just fine, I think.If you need it for test purpose, you can find my repo here: https://github.com/pau-a-velo/pau-a-velo-websource
The text was updated successfully, but these errors were encountered: