Scroll to top

May 14, 2021

The home on the web of Colin Walker.
Find out more on /about, say /EHLO, or tune in to the daily RSS feed.

May 14, 2021#p3

Inspired by Doug Belshaw's efforts to create small web pages I decided to look at the performance of my own.

I immediately realised I didn't have gzip compression enabled on the server and then looked at adding defer attributes to script and stylesheet links. This reduced my 'first contentful paint' (FCP – the time it takes to get something up on screen that someone can see) by 0.6 seconds. The only problem was that it broke some of the functionality.

Stylesheets appear to be deferrable but my script files are not – without loading them when required things like fragmentions and highlighting linked comments don't work.

Having had essentially the same look for 6 years (on WordPress and the new site) I have been reluctant to get rid of the Open Sans and Open Sans Condensed fonts, although they are self-hosted now rather than using Google Fonts. I like the contrast between the two fonts but have been experimenting with returning to default fonts. Not only does this simplify things but it reduces the overall size of the site and (on the test site) reduces the FCP even further to less than one second.

Using negative letter-spacing I can condense certain elements to approximate the effect the font variants provided and I think it's a worthy trade-off for the size and performance improvements.