You can’t. Apart from the fact, that your server decides how to compress and send data and your browser decides, how to cache data you will never know before you received data how much data you will receive, except it’s something like a single non-cached PDF file. The numbers you could retrieve (with a python script nonetheless) are arbitrary and uncompressed and probably even depend on the format of your hard drive.
But none of that is a Hugo task. It depends on the browser and server setup.
There is a header called “content length” that has some byte info, per object that is sent. This again is something going on at the clients side.
Having read my rambling until here: thanks there is probably a way to calculate (fake) sizes, but not in a “hey Hugo, calulate all my files and assets sizes” way:
OT:
My web files are pre-compressed after deployment with shell scripts. Here some data
favicon is 309.326 bytes, with Brotli 4.326 bytes, with Zopfli 4.206 bytes. homepage is 18.447 bytes, with Brotli 3.734 bytes, with Zopfli 4.185 bytes. tachions stylesheet is 118.299 bytes, minify 77.252 bytes, with Brotli 8.013 bytes, with Zopfli 11.314 bytes.
That’s a great idea that will bring the serve-time down some milliseconds… I love milliseconds
Don’t forget to share your shell scripts… I am probably not the only one interested. And thinking about it, you probably have to add some HTTP headers about that?