Website Speed Optimization: 15 Proven Techniques
Why Speed Matters
Google confirmed page speed as a ranking factor. Faster sites also convert better:
- 1 second delay = 7% less conversions
- 53% of mobile users leave if page takes 3+ seconds
- Core Web Vitals are a ranking signal
15 Speed Optimization Techniques
Server-Side (1-5)
**1. Enable Compression**
# Nginx
gzip on;
gzip_vary on;
gzip_min_length 256;
gzip_types text/plain text/css application/json application/javascript text/xml;
**2. Set Cache-Control Headers**
# Static assets — cache for 1 year
location ~* \.(css|js|jpg|png|svg|woff2)$ {
add_header Cache-Control "public, max-age=31536000, immutable";
}
**3. Use a CDN**
Cloudflare (free) or AWS CloudFront. Serves content from edge servers closest to users.
**4. Upgrade to HTTP/2 or HTTP/3**
HTTP/2 allows multiplexing (multiple files over one connection). Most modern servers support it.
**5. Optimize Time to First Byte (TTFB)**
- Use server-side caching (Redis, Varnish)
- Optimize database queries
- Use static site generation when possible
Frontend (6-10)
**6. Lazy Load Images**
<img src="photo.jpg" loading="lazy" alt="Description" width="800" height="600">
**7. Use Modern Image Formats**
<picture>
<source srcset="photo.avif" type="image/avif">
<source srcset="photo.webp" type="image/webp">
<img src="photo.jpg" alt="Description">
</picture>
**8. Defer Non-Critical JavaScript**
<script src="analytics.js" defer></script>
<script src="chat-widget.js" async></script>
**9. Inline Critical CSS**
Extract above-the-fold CSS and inline it in the HTML head. Load remaining CSS asynchronously.
**10. Preconnect to Third-Party Domains**
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="dns-prefetch" href="https://www.google-analytics.com">
Content (11-15)
**11. Optimize Font Loading**
@font-face {
font-family: 'Inter';
src: url('/fonts/inter.woff2') format('woff2');
font-display: swap;
}
**12. Remove Unused CSS/JS**
Use Chrome DevTools Coverage tab to find unused code.
**13. Minimize DOM Size**
Keep under 1500 DOM elements. Deep nesting slows rendering.
**14. Avoid Layout Shifts (CLS)**
Always set width/height on images and embeds.
**15. Reduce Third-Party Scripts**
Each third-party script adds 50-200ms. Audit and remove unnecessary ones.
Measuring Speed
Use [SEO Snapshot](/) to check:
- Response time (TTFB)
- Compression status
- Cache-Control headers
- Render-blocking resources
- Lazy loading usage
- Page weight estimation
- Request count
- Third-party script detection
FAQ
**Q: What's a good page load time?**
A: Under 3 seconds. Aim for under 2 seconds for competitive advantage.
**Q: Does page speed directly affect rankings?**
A: Yes. Core Web Vitals (LCP, INP, CLS) are confirmed ranking factors.
**Q: Which optimization has the biggest impact?**
A: Compression + caching. They're server-side changes that affect every page instantly.
Check your site's SEO score for free
Analyze your site