Eleventy in a Box
A premium Eleventy starter kit for designers and developers who want to spend less time setting up the same project structure and more time designing distinctive websites.
I’ve been making a load of small changes to this website recently, and I knew that it needed a proper tune-up, especially on mobile, where performance really matters.
Before the refresh, my mobile performance score was stuck at 80. Not terrible, but not where I wanted it to be. Here’s how I pushed it up to 96, step by step.
First things first—I ran Google PageSpeed Insights on my site. It flagged a few usual suspects:
Images were an obvious place to start, as they weren’t adapting to different device widths.
My portfolio sections contain lots of images of my work, and I host them on the Cloudinary CDN. The key to optimisation was to serve correctly sized images, in efficient formats like WebP, and with quality optimised automatically. Cloudinary makes this easy with URL parameters.
srcset with multiple widths so browsers can choose the best sizef_auto and q_auto params to deliver the correct format and compressionsizes so the browser knows the image display sizeloading="lazy" and decoding="async" for non-blocking load and decodewidth and height attributes to avoid layout shifts<img
src=".../upload/f_auto,q_auto,w_500/..."
srcset="
.../upload/f_auto,q_auto,w_320/... 320w,
.../upload/f_auto,q_auto,w_500/... 500w,
.../upload/f_auto,q_auto,w_800/... 800w"
sizes="(max-width: 600px) 100vw, 500px"
width="500"
height="390"
loading="lazy"
decoding="async"
alt=""
/>This new markup significantly reduced the image payload on smaller devices, speeding up load times and improving Core Web Vitals.
Fonts can be sneaky performance killers as they often block rendering while loading. I adjusted my font CSS to use:
@font-face {
font-display: optional;
/* other font-face properties */
}This change tells the browser to render text immediately with fallback fonts if needed, then it swaps in the web fonts once they load, without blocking the initial render.
After these tweaks, my PageSpeed Insights mobile score increased to 96, which I consider a solid win. The site still looks just as sharp, but now it’s snappy and responsive for visitors on slower connections or less powerful devices.
If you want to chat about how to optimise your site’s performance, drop me a line. Happy to help.
A premium Eleventy starter kit for designers and developers who want to spend less time setting up the same project structure and more time designing distinctive websites.
Contract Killer is plain and simple and there’s no legal jargon. It’s customisable to suit your business and has been used on countless web projects since 2008.
Free compound grid and modular grid layout generators, plus a set of HTML/CSS layout templates you can call on to make more interesting layouts, available to buy.