Website Speed Optimization: Core Web Vitals and Performance
A one-second delay in page load time can reduce conversions by 7%. Website speed isn't just a technical metric. It directly impacts your revenue, search rankings, and user satisfaction. Here's everything you need to know about making your site fast.
Why Speed Matters
The data is unambiguous: slow websites lose money. Here's what the research shows:
- 53% of mobile visitors abandon a page that takes longer than 3 seconds to load
- 79% of online shoppers who experience a slow site say they won't return
- A 100-millisecond improvement in load time can increase conversion rates by 8.4% for retail sites
- Google uses page speed as a ranking factor for both mobile and desktop searches
Speed isn't a nice-to-have optimization. It's table stakes for any business that depends on its website for leads or sales.
Core Web Vitals Explained
Core Web Vitals are Google's specific metrics for measuring user experience. They became an official ranking factor in 2021 and remain central to how Google evaluates page experience.
The Three Core Web Vitals
- Largest Contentful Paint (LCP): Measures loading performance. How quickly does the main content of the page become visible? Target: under 2.5 seconds.
- Interaction to Next Paint (INP): Measures interactivity. How quickly does the page respond when users click, tap, or type? Target: under 200 milliseconds.
- Cumulative Layout Shift (CLS): Measures visual stability. Does the page content shift around unexpectedly as it loads? Target: under 0.1.
Image Optimization
Images are typically the largest files on any web page, often accounting for 50 to 80% of total page weight. Optimizing images is usually the single biggest speed improvement you can make.
Format Selection
- WebP: Modern format that provides 25 to 35% smaller files than JPEG at equivalent quality. Supported by all modern browsers.
- AVIF: Even more efficient than WebP (up to 50% smaller), but slower to encode and less widely supported
- JPEG: Still fine for photographs where WebP isn't an option
- PNG: Use only when you need transparency. Otherwise, WebP or JPEG is smaller.
- SVG: Ideal for logos, icons, and simple graphics. Infinitely scalable with tiny file sizes.
Sizing and Compression
- Never serve an image larger than it displays on screen. A 3000px image displayed at 600px wastes 80%+ of the bandwidth.
- Use responsive images with
srcsetto serve different sizes for different devices - Compress images to 80 to 85% quality. The file size reduction is dramatic with minimal visible difference
- Tools: Squoosh (free, browser-based), ShortPixel, TinyPNG, or ImageOptim
Lazy Loading
Lazy loading defers loading images until they're about to enter the viewport. This means images below the fold don't slow down the initial page load.
Add loading="lazy" to image tags for images below the fold. Never lazy-load the hero image or above-the-fold content, as that would hurt LCP.
Caching Strategies
Caching stores copies of your website files so returning visitors don't have to download everything again. This dramatically improves load times for repeat visits.
Types of Caching
- Browser caching: Tells visitors' browsers to store static files (images, CSS, JS) locally for a set period. Configure via server headers.
- Server-side caching: Stores generated HTML pages so the server doesn't rebuild them for every request. Essential for dynamic CMS sites like WordPress.
- CDN caching: Content Delivery Networks store copies of your files on servers worldwide, serving them from the location closest to each visitor.
Code Optimization
Minification
Minification removes unnecessary characters from code (whitespace, comments, long variable names) without changing functionality. This typically reduces CSS and JavaScript file sizes by 20 to 40%.
Reducing JavaScript
JavaScript is the most expensive resource on the web. Unlike images that only need to be decoded, JavaScript must be downloaded, parsed, compiled, and executed. Every kilobyte of JavaScript costs more than a kilobyte of anything else.
- Audit your scripts: remove tracking codes, widgets, and plugins you're not actively using
- Defer non-critical JavaScript using
deferorasyncattributes - Consider whether you really need that jQuery library for a few animations
- Use code splitting to load JavaScript only when needed
CSS Optimization
- Inline critical CSS (above-the-fold styles) in the HTML head for faster first paint
- Remove unused CSS. Tools like PurgeCSS can identify dead rules.
- Avoid render-blocking CSS by loading non-critical styles asynchronously
Server and Hosting
The fastest code in the world can't overcome a slow server. Your hosting environment sets the baseline for site performance.
- Choose quality hosting: Cheap shared hosting ($3/month plans) often means slow response times and shared resources with hundreds of other sites
- Use a CDN: Services like Cloudflare (free tier available) distribute your content globally and add security
- Enable HTTP/2 or HTTP/3: Modern protocols allow multiple file transfers simultaneously
- Use GZIP or Brotli compression: Reduces file transfer sizes by 60 to 80% for text-based files
- Optimize Time to First Byte (TTFB): Target under 200ms for server response time
Preventing Layout Shift (CLS)
Layout shift happens when visible elements move unexpectedly: text jumping as an ad loads above it, or a button moving right as you're about to click it. It's one of the most frustrating user experiences on the web.
- Set explicit dimensions on images and videos (
widthandheightattributes) - Reserve space for ads, embeds, and dynamically loaded content
- Avoid inserting content above existing content after the page has started rendering
- Use CSS aspect-ratio or padding-based aspect ratio boxes for responsive media
- Preload web fonts and use
font-display: swapto prevent invisible text
Testing and Measuring Performance
You can't improve what you don't measure. Use these tools to benchmark and monitor your site speed:
Performance Testing Tools
- Google PageSpeed Insights: Free tool showing Core Web Vitals scores plus specific optimization recommendations
- GTmetrix: Detailed performance reports with waterfall charts showing what loads and when
- WebPageTest: Advanced testing from multiple locations and devices with filmstrip comparisons
- Chrome DevTools: Built-in Performance and Lighthouse panels for real-time debugging
- Google Search Console: Core Web Vitals report showing real-user performance data across your entire site
Test from multiple locations and devices. Your site might load fast on your office Wi-Fi but struggle on a mobile connection in another state. Real-user data (from Google Search Console) is always more valuable than lab tests.
Key Takeaways
- Website speed directly impacts conversions, search rankings, and user satisfaction
- Core Web Vitals (LCP, INP, CLS) are Google's official performance metrics. Know your scores
- Image optimization is usually the single biggest speed improvement available
- Reduce JavaScript first when optimizing code. It's the most expensive resource type
- Quality hosting and CDN usage set the baseline. No amount of optimization overcomes a slow server
- Measure with real tools, test on real devices, and monitor performance over time
Want a website that loads instantly?
I build performance-optimized websites that score high on Core Web Vitals and keep visitors engaged.
Start Your Project