Skip to content
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

Open
lamyseba opened this issue Nov 13, 2020 · 0 comments
Open

Comments

@lamyseba
Copy link

lamyseba commented Nov 13, 2020

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, with renderToDisk parameter, all the resources are copied on the destinationDir, 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 the hugo server command cares about not copying static files that already exists in destinationDir.

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 the destinationDir). This shall also apply to generated resources cached in resources/_gen (tipically, resized images). They should not be copied to destinationDir if destinationDir 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

@lamyseba lamyseba changed the title Hugo server shall synchronize pages static resources when it launches, not always overwrite existing files in destinationDir Hugo server command shall synchronize pages resources, not always overwrite Nov 14, 2020
@bep bep modified the milestones: v0.79, v0.80 Nov 27, 2020
@bep bep modified the milestones: v0.80, v0.81 Jan 2, 2021
@bep bep modified the milestones: v0.81, v0.82 Feb 19, 2021
@bep bep modified the milestones: v0.82, v0.83 Mar 21, 2021
@bep bep modified the milestones: v0.83, v0.84 May 1, 2021
@bep bep modified the milestones: v0.84, v0.85 Jun 18, 2021
@bep bep modified the milestones: v0.85, v0.86 Jul 5, 2021
@bep bep modified the milestones: v0.86, v0.87, v0.88 Jul 26, 2021
@bep bep modified the milestones: v0.88, v0.89 Sep 2, 2021
@bep bep modified the milestones: v0.89, v0.90 Nov 2, 2021
@bep bep modified the milestones: v0.90, v0.91.0 Dec 13, 2021
@bep bep modified the milestones: v0.91.0, v0.92.0 Dec 22, 2021
@bep bep removed this from the v0.92.0 milestone Jan 12, 2022
@bep bep modified the milestones: v0.116.0, v0.117.0 Aug 1, 2023
@bep bep modified the milestones: v0.117.0, v0.118.0 Aug 30, 2023
@bep bep modified the milestones: v0.118.0, v0.119.0 Sep 15, 2023
@bep bep modified the milestones: v0.119.0, v0.120.0 Oct 4, 2023
@bep bep modified the milestones: v0.120.0, v0.121.0 Oct 31, 2023
@bep bep modified the milestones: v0.121.0, v0.122.0 Dec 6, 2023
@bep bep modified the milestones: v0.122.0, v0.123.0, v0.124.0 Jan 27, 2024
@bep bep modified the milestones: v0.124.0, v0.125.0 Mar 4, 2024
@bep bep modified the milestones: v0.125.0, v0.126.0 Apr 23, 2024
@bep bep modified the milestones: v0.126.0, v0.127.0 May 15, 2024
@bep bep modified the milestones: v0.127.0, v0.128.0 Jun 8, 2024
@bep bep modified the milestones: v0.128.0, v0.129.0 Jun 21, 2024
@bep bep modified the milestones: v0.129.0, v0.131.0 Jul 22, 2024
@bep bep modified the milestones: v0.131.0, v0.133.0 Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants