I’m looking at ways to increase the speed of already fast micro.blog websites.
Looking at the PageSpeed results of micro.blog sites such as news.micro.blog.
There’s a few easy wins that I think can be implemented to speed up everyone’s blogs and reduce overall bandwith for micro.blog.
First of all, enable gzip and brotli compression on the Caddy servers which server the blogs. This has been brought up before and is a pretty easy win.
Second, add cache TTL to static assets of 365 days or 31536000 seconds. The default themes already have cache busting static elements, so this shouldn’t casue any issues. Could take this a step further and update the default themes to serve webP images resized correctly. This has been suggested before but no one suggested a TTL — it should be 365 days.
Third, add the build flag --minify to the Hugo build pipeline. Hugo has the annoying quality of creating lots of white space in the generated .html pages. Basically, whereever there is Go templating logic, this gets turned into whitespace newlines in the generated .html. Take a look at the .html source of your micro.blog. This is just wasted bytes and the --minify tag will strip this in the build step. Seperate to this, could we have the ability to add custom flags to the build step?
When you edit your config, it does not mess with the defaults. Manton combines the files, using the default first, then overriding any values you specify inside your config (or adding them if they didn’t previously exist).
There is no need to edit or include any default you don’t intend to override.
For example, my theme config.json contains the following only:
It’s not applying the configurations. My inline shortcode is not compiling and the output is not minimised. Both of those things happned with the .yaml file, but that overwrote the default config.
Sorry, I forgot to mention something: there is a hard-coded list of allowed config fields that can be overridden. security and minify aren’t allowed, but I can enable them.
Oh interesting. Yes could you’d up let those be overridden? The inline shortcodes like inline html is not dangerous if you own the content, and quite useful.
Could you let us know what are the list of configs that can be overridden?
I haven’t enabled security yet. There are some fields that we may not be able to allow — because security — so I need to review each field individually. Can you explain more about how you’d like to use enableInlineShortcodes? I wasn’t familiar with it before now.