Home / Learn HTML / HTML Performance and Loading
HTML Performance and Loading
Faster pages keep visitors and rank better. A few HTML attributes do most of the work.
Definition
Performance is how fast your page loads and reacts. Slow pages lose visitors and rank lower. The biggest wins in HTML are small images, lazy loading, defer on scripts and fewer requests.
Theory in plain words
What it is
Performance is how fast a page loads and responds.
Why we use it
Slow pages lose visitors and search ranking.
How it works
Smaller files, lazy loading, caching and fewer blocking scripts make the browser show content sooner.
Where it is used
- Landing pages
- Shops
- Mobile users on slow networks
Browsers use the first format they know. AVIF and WebP are much smaller than JPG.
Tell the browser the main image is most important.
- Compress images before you upload.
- Remove unused CSS and JavaScript.
- Use a CDN and caching on your server.
- Keep the number of requests low.
Quick quiz
1. Which attribute delays script run until the page is parsed?
defer keeps page fast.
2. Which makes images load when near the screen?
Lazy loading saves data.
3. Modern small image formats
They are far smaller than JPG.
Common questions
Which attribute delays script run until the page is parsed?
defer. defer keeps page fast.
Which makes images load when near the screen?
loading="lazy". Lazy loading saves data.