Why Speed Matters (The Numbers)
For Indian websites specifically, the average mobile connection speed is 17 Mbps on 4G — significantly slower than global averages. Optimizing for this reality is essential.
12 Speed Optimization Techniques
1. Compress and Convert Images Use WebP/AVIF format instead of JPEG/PNG. A 500KB JPEG becomes a 70KB WebP with no visible quality loss. Use tools like Squoosh or sharp (Node.js).
2. Implement Lazy Loading
Load images and videos only when they enter the viewport. Native HTML: ``. For React: use Intersection Observer API.
3. Enable Brotli/Gzip Compression Brotli reduces text-based files (HTML, CSS, JS) by 70-80%. Most CDNs and hosting providers support it — you just need to enable it.
4. Use a CDN (Content Delivery Network) Cloudflare (free tier available) or AWS CloudFront. Indian users get content from Mumbai/Chennai servers instead of US/Europe.
5. Minify CSS, JavaScript, and HTML Remove whitespace, comments, and unused code. Vite and Next.js do this automatically in production builds.
6. Code Split and Tree Shake Only load the JavaScript needed for the current page. React.lazy() and dynamic imports can reduce initial bundle size by 60%.
7. Optimize Web Fonts Subset fonts to include only needed characters (Latin/Devanagari). Use font-display: swap. Preload critical fonts.
8. Implement Caching Headers Set Cache-Control headers: Static assets (1 year), HTML (no-cache or short TTL), API responses (appropriate TTL).
9. Preconnect to Required Origins Add `` for third-party domains (fonts, analytics, CDNs) to eliminate DNS lookup time.
10. Reduce Third-Party Scripts Each analytics/chat/CRM script adds 50-200ms. Audit and remove unused scripts. Load non-essential scripts async.
11. Use HTTP/2 or HTTP/3 HTTP/2 multiplexes requests, eliminating head-of-line blocking. Most modern hosting supports it by default.
12. Server-Side Rendering or Static Generation Pre-render your pages at build time (SSG) or on the server (SSR). This eliminates the blank-screen-while-JS-loads problem and dramatically improves LCP.
Measuring Speed: Tools That Matter
Always test from Indian server locations or on actual 4G devices. Lab scores from US servers don't reflect your users' real experience.