This one was in my head for quite some time now, and I finally managed to check it out.

The question

Hugo has got the --minify keyword. How much does this influence the size of my blog?

The analysis

I have got two Hugo sites that I currently maintain: This blog, and a website for a local event. For testing out, I did the following:

  • Run hugo without any arguments
  • Run hugo with the --minify argument

I then compared the outcomes by just running du -sh ${the_correct_directory}.

  • For my blog, the outcome actually makes a difference: In minified, my blog in the current version has got a size of 4.2MB, and 4.7MB in non-minified.
  • For the event website, the size did not change at all. This is probably since there is not too much HTML content; most of the size comes from font files and images.

The conclusion

Realistically, this difference is not worth mentioning. In our times, we don’t have to optimize everything, and if a file has a size of 10kb or 11kb really does not make a difference.

It is still worth to think about that. On my small blog with about 60 posts, I spare 0.5MB - a number that grows with blog size obviously.
In particular, one realizes that for added readability in my template files, I added 0.5MB of whitespaces.