How we reduced CSS size and improved performance across GOV.UK – Government Digital Service

February 1, 2024

We recently reduced CSS size and improved performance across GOV.UK pages by moving away from bundling all CSS into a single stylesheet served to all pages to serving smaller stylesheets containing only the necessary styles for each page. There have been reductions of up to 40% in CSS size on some pages, accompanied by incremental improvements in timing metrics across many pages. These improvements could lead to a slightly faster experience for users accessing GOV.UK through older or low end devices or for people on slower connections.

Source: How we reduced CSS size and improved performance across GOV.UK – Government Digital Service

The UK’s Government Digital Service often publishes lessons they’ve learned, and this one summarises some of their very effective techniques for increasing performance by reducing CSS size.