osric.uk

Oh, in technical news, all* pages from this site should be minimized! That's the (generated) HTML and any inline CSS/JS.

*Pages that the minifier can't parse don't get squished

I've written a tag helper that runs the content of any <html> tags through NUglify. (I was already using NUglify to minimize JavaScript files, any .min.js file gets squashed (and cached) on the way out).

It was a little bit of a journey. I wasn't happy with the previous look of the site, so I removed all the CSS. That didn't last very long, but instead of adding <link rel=stylesheet> tags back, I added <style> tags inline in the header, on the grounds that I don't want a lot of CSS, even if I need some, and keeping inline is faster/more efficient than another round trip.

(All the "speed up your site" posts say one should include enough CSS to render the page inline)

However, even a small amount of CSS leads to much whitespace, and I was feeling twitchy. I wrote a quick MinifyCssTagHelper that looked for <style> tags to minify, and that worked surprisingly well, surprisingly quickly. Given how well it worked, it was an obvious next step to try HTML minification, and yeah, that worked to.

It doesn't save much (traditionally, turning on response compression gives far more savings than minification), but it saves something, and it's really cool.