HTML document size is reasonable
mediumhtml_size
Checks that the HTML document size is reasonable.
What does this rule check?
The raw HTML document size should be reasonable (under 100KB for most pages). Excessively large HTML indicates inline data, embedded SVGs, or server-rendered content that should be optimized.
Why is this important?
Large HTML documents take longer to download and parse. They delay DOM ready time and increase memory usage, especially on mobile devices.
How to fix
Move inline styles/scripts to external files. Paginate long lists. Use lazy-loading for dynamic content.
Examples
Incorrect
<!-- 500KB HTML document with embedded SVGs and inline data -->
Correct
<!-- 30KB HTML document with external assets -->
Agent fix snippet
Copy this snippet and paste it into your AI coding agent to fix this issue automatically.
Reduce HTML size:
1. Move inline CSS to external files
2. Move inline JS to external files
3. Remove HTML comments in production
4. Paginate long lists
5. Externalize embedded SVG sprites