Website speed optimization: what actually makes your site faster
Skip the theory. Here are the specific fixes that shave real seconds off your load time.
How speed affects SEO and conversions
Google has used page speed as a ranking factor since 2018, and Core Web Vitals made it even more important. But the real cost of a slow site is not rankings. It is the customers who leave before your page finishes loading.
Image optimization: the biggest quick win
Images account for 50-70% of total page weight on most sites. Fixing images alone can cut your load time in half without touching a single line of code.
WebP images are 25-35% smaller than JPEG at the same quality. Every modern browser supports it. Convert your existing images using Squoosh or ShortPixel.
Never upload a 4000px image for a 800px container. Resize to the maximum display size, then compress. This alone can save megabytes per page.
- Compress every image to under 200KB before upload.
- Use srcset to serve different sizes for mobile and desktop.
- Set explicit width and height attributes to prevent layout shift.
- Convert PNG to WebP unless you need true transparency.
Lazy loading: load only what they see
Lazy loading delays the download of images and videos until the user scrolls near them. This means your above-the-fold content loads faster because it is not competing with content below.
Add loading="lazy" to any img tag below the fold. No JavaScript needed. Supported in all modern browsers since 2020.
Your main hero image should load immediately. Lazy loading it actually hurts your LCP score. Only apply lazy loading to images further down the page.
Minifying CSS and JavaScript
Minification strips whitespace, comments, and unnecessary characters from your code. The browser does not need pretty formatting. Smaller files download faster.
| Action | Tool | Typical savings |
|---|---|---|
| Minify CSS | cssnano, clean-css | 15-25% file size reduction |
| Minify JavaScript | Terser, esbuild | 20-40% file size reduction |
| Remove unused CSS | PurgeCSS | 50-90% reduction on sites using frameworks |
Choosing good hosting
You can optimize everything on your site and still be slow if your server takes 2 seconds to respond. Hosting is the floor of your performance. A bad floor means everything built on top is slower.
Fine for a brochure site with low traffic. Expect 200-600ms server response times. If your TTFB is above 800ms, your host is the problem.
Services like Cloudflare Pages, Netlify, or Vercel serve files from edge servers near your visitors. TTFB drops to 50-150ms globally.
Measuring with PageSpeed Insights
Google PageSpeed Insights gives you both lab data and real-user data. Use it as your baseline before making changes and your scorecard after.
- Test your homepage, your most visited service page, and one blog post.
- Focus on the three Core Web Vitals: LCP, FID/INP, and CLS.
- Read the "Opportunities" section. It lists fixes sorted by impact.
- Test on mobile first. Mobile scores are always lower and matter more.
Largest Contentful Paint measures how fast the main content loads. Fix images and server speed to improve this.
Cumulative Layout Shift catches elements jumping around. Set image dimensions and avoid injecting content above the fold.
Quick wins vs long-term fixes
Not every optimization takes the same effort. Start with the quick wins that give outsized results, then tackle the deeper fixes when you have time.
| Fix | Effort | Impact |
|---|---|---|
| Compress images | 10 minutes | High - often saves 1-3 seconds |
| Add lazy loading | 5 minutes | Medium - faster initial paint |
| Enable browser caching | 15 minutes | High - returning visitors load instantly |
| Switch to CDN hosting | 1-2 hours | High - cuts TTFB globally |
| Remove unused CSS/JS | 2-4 hours | Medium - depends on bloat level |