5 Ways to Reduce HTML File Size on Your Website, Step 0
Published on Apr 16, 2025, filed under development (feed). (Share this on Mastodon or Bluesky?)
Anna Monus of DebugBear wrote about 5 Ways to Reduce HTML File Size on Your Website. Strangely, or interestingly, the most immediate way is missing:
Remove the HTML that isn’t needed, i.e., all optional HTML. *
What is optional HTML? Optional start and end tags, optional quotes, and attribute value defaults. Optional HTML: Everything You Need to Know provides an overview.
Why omit optional HTML? As Anna says, to reduce HTML file size and improve performance; you find a similar argument in HTML and Performance: Leave Out Optional Tags and Quotes.
It’s not a popular practice, but that doesn’t change the fact that omitting optional HTML is quite literally a valid performance optimization measure, and a pillar of writing minimal HTML.
If this is your first visit on this website, welcome! I write a lot about HTML optimization, meaning HTML that is valid (error-free), semantic, accessible, and minimal.
* I like to focus this on optional HTML, but another opportunity to reduce HTML file size lies in validation. This is because erroneous HTML code may be code that can be removed. And because we know that large commercial websites usually come with validation and therefore conformance issues, this has become an actual performance optimization vector.