Improving Site Speed for E-commerce: A Data-Driven Approach
The relationship between page speed and e-commerce revenue is one of the most thoroughly documented correlations in digital business. Amazon famously calculated that every 100ms of additional latency cost them 1% of sales. More recent data from Google’s research on page speed and conversions shows that as page load time increases from 1 second to 3 seconds, the probability of bounce increases by 32%. Increase it to 5 seconds and bounce probability rises 90%. These are not theoretical figures—they represent real purchase decisions made by real customers who couldn’t be bothered to wait.
Despite this evidence, most e-commerce stores are slower than they should be. App ecosystems add JavaScript. Design decisions add image weight. Caching isn’t configured. The result is a store that was fast on launch day and is progressively slower as functionality accumulates. This guide walks through a systematic, data-first approach to identifying and fixing e-commerce performance problems.
Step 1: Measure Before You Optimize
The single most common mistake in performance optimization is fixing things without first measuring what’s actually slow. Optimization without measurement leads to investing effort in changes that don’t meaningfully move your real-world performance.
Tools You Need
Google PageSpeed Insights: The starting point. PageSpeed Insights provides both lab data (Lighthouse scores) and field data (Core Web Vitals from real users in the Chrome User Experience Report). The field data is more important for understanding actual user experience—it reflects what your real visitors on real devices and networks experience.
Google Search Console: The Core Web Vitals report in Search Console shows field data aggregated across your actual traffic, segmented by page group (product pages, collection pages, home page, etc.). This tells you which page types have the worst real-world performance. Navigate to Experience > Core Web Vitals.
WebPageTest: WebPageTest provides deeper diagnostics than PageSpeed Insights, including waterfall charts showing every network request, time to first byte, and the ability to test from specific geographic locations on specific connection speeds. This is where you identify exactly which resources are slow and why.
Lighthouse in Chrome DevTools: Running Lighthouse locally (Chrome DevTools > Lighthouse tab) allows you to test on a staging environment before deploying changes, so you can validate improvements before they go live.
The Metrics That Matter
Focus on Core Web Vitals—these are the metrics Google uses for ranking signals:
-
Largest Contentful Paint (LCP): Time until the largest visible content element loads. Target: under 2.5 seconds. LCP is usually a hero image, product image, or heading. Slow LCP is typically caused by slow server response, render-blocking resources, slow resource load times, or client-side rendering delays.
-
Interaction to Next Paint (INP): Responsiveness of the page to user input. Target: under 200ms. Poor INP is caused by heavy JavaScript execution blocking the main thread.
-
Cumulative Layout Shift (CLS): Visual stability—how much elements shift during loading. Target: under 0.1. CLS is caused by images without defined dimensions, dynamically injected content, and fonts that cause text to reflow when loaded.
Step 2: Image Optimization
Images account for the largest share of page weight on most e-commerce sites. They’re also among the highest-impact optimizations available.
Format: Switch to WebP and AVIF
JPEG and PNG are legacy formats. WebP provides equivalent visual quality at 25–34% smaller file sizes. AVIF provides 50%+ smaller files at equivalent quality compared to JPEG. Google’s WebP documentation covers browser support and implementation.
In 2025, all major browsers support WebP. AVIF has near-universal support with minor caveats. The implementation strategy: serve AVIF to browsers that support it, WebP as fallback, original format as final fallback. This is most cleanly handled through a CDN with image transformation capability (Cloudflare Images, Cloudinary, Imgix).
Shopify automatically serves WebP versions of uploaded images to supporting browsers. WooCommerce requires either a plugin (Imagify, ShortPixel, WebP Express) or a CDN with format transformation.
Dimensions: Never Serve Larger Than Displayed
A product image displayed at 800px wide should be served at 800px wide—not at 3000px wide (the resolution it was photographed in). This is the most common and most wasteful image mistake.
Use responsive images (srcset and sizes attributes) to serve appropriately sized images based on the device’s screen width. A mobile device displaying an image at 400px should receive a 400px image, not the same 1600px image your desktop users receive.
Lazy Loading
Images below the fold should not load until the user scrolls toward them. Implement loading="lazy" on all images except those visible in the initial viewport (hero image, product image above the fold). This can reduce initial page load significantly on content-heavy pages.
Compression
Even properly formatted and sized images should be compressed. Quality 80 in WebP is typically indistinguishable from lossless at a fraction of the file size. Automate compression as part of your image upload workflow.

Step 3: JavaScript Reduction and Optimization
JavaScript is the second-largest contributor to slow e-commerce pages, and in many cases the primary cause of poor INP scores. Every app, widget, and integration that adds JavaScript to your storefront increases the time the browser spends downloading, parsing, and executing scripts.
Audit Your JavaScript Load
Use the Coverage tool in Chrome DevTools (press F12, then Ctrl+Shift+P, search “Coverage”) to see how much of each JavaScript file is actually used on a given page. Unused JavaScript is pure waste—the browser downloads and parses it but never executes the relevant code.
Typical offenders in Shopify stores include:
- Chat widget scripts loading on every page, even when chat is rarely used
- Review widget scripts loading on collection pages where no reviews are displayed
- Social sharing scripts with large dependencies
- Abandoned A/B testing scripts from removed experiments
Defer and Async Non-Critical Scripts
JavaScript that doesn’t need to execute before the page is interactive should be deferred. Using the defer attribute on script tags allows the browser to continue parsing HTML while downloading the script, and executes scripts only after parsing is complete.
Async: Downloads in parallel, executes immediately when downloaded (can interrupt parsing) Defer: Downloads in parallel, executes only after HTML parsing is complete (preserves order)
For most third-party scripts (analytics, chat, marketing pixels), defer is the appropriate attribute. Critical scripts (payment processing, core functionality) should not be deferred.
Third-Party Script Management
Third-party scripts—Google Analytics, Meta Pixel, chat widgets, review widgets, loyalty apps—have performance costs that you don’t control. They can have slow servers, large payloads, and render-blocking behavior.
Use Google Tag Manager to manage third-party scripts centrally. This allows you to: add scripts without developer intervention, use triggers to fire scripts only on relevant pages, and implement consent-based loading (required for GDPR compliance).
Load third-party scripts with performance budget awareness. Every new app in Shopify that adds a global JavaScript include is a performance cost. Before adding any app, check its JavaScript footprint.
Step 4: Caching Strategy
Caching reduces server load and dramatically speeds up page delivery for returning visitors. The implementation differs significantly between hosted platforms and self-hosted stores.
For WooCommerce Stores
WooCommerce’s dynamic pricing, cart awareness, and session handling create challenges for page caching. The wrong caching configuration can serve cached pages with incorrect cart contents or pricing.
Key rules for WooCommerce caching:
- Never cache cart, checkout, order confirmation, or my account pages. These are user-specific and must be served fresh.
- Cache product and collection pages for logged-out users.
- Use a full-page caching plugin like WP Rocket, W3 Total Cache, or LiteSpeed Cache (if your host supports LiteSpeed).
- Enable object caching (Redis or Memcached) for database query results. This dramatically improves server response time for complex product queries. WooCommerce’s performance documentation covers object caching configuration.
- Use a CDN for static assets (images, CSS, JS). Cloudflare’s free tier provides meaningful performance improvement. Cloudflare Pro adds more aggressive caching and optimization features.
For Shopify Stores
Shopify handles most caching at the infrastructure level. Their CDN (Fastly) distributes static assets globally. Your optimization levers are more limited but still meaningful:
- Ensure your theme’s CSS and JavaScript files are minified
- Use Shopify’s section rendering API to enable partial page updates rather than full page reloads for filter and sort operations
- Avoid app-injected scripts that bypass Shopify’s asset pipeline
Step 5: Server Response Time (TTFB)
Time to First Byte (TTFB) is how long the browser waits before receiving the first byte of a response from the server. A slow TTFB delays everything else—no optimization to JavaScript or images helps until the server responds.
For WooCommerce: TTFB is directly affected by your hosting quality. Shared hosting with slow PHP execution is a major TTFB problem. Upgrade to a managed WordPress host (Kinsta, WP Engine, Cloudways) if your TTFB consistently exceeds 600ms. Enable PHP 8.1+ (WooCommerce 7+ requires it and it’s significantly faster than older PHP versions). Implement object caching.
For Shopify: TTFB is controlled by Shopify’s infrastructure. Your lever is theme code complexity—a theme with complex Liquid that requires many database queries will have slower TTFB than a leaner theme. Reduce the number of product metafield lookups, collection queries, and dynamic sections on high-traffic pages.
Step 6: Font Optimization
Custom fonts add HTTP requests and can cause layout shift when they load. Common font-related performance issues:
Font render-blocking: Fonts that block page rendering until they load cause blank text (FOIT—Flash of Invisible Text) or layout shifts (FOUT—Flash of Unstyled Text). Use font-display: swap to show a system font while the custom font loads, preventing invisible text.
Excessive font weights and styles: Loading 8 font variants when you use 2 is waste. Audit your font usage and load only what’s needed.
Self-host fonts where possible: Loading fonts from Google Fonts adds a DNS lookup and external request. Self-hosting eliminates that dependency and allows better cache control. Google’s guide on optimizing Google Fonts covers self-hosting setup.
Measuring the Impact
After implementing optimizations, measure results using the same tools you used to establish your baseline. Expect:
- LCP improvements from image optimization and caching
- INP improvements from JavaScript reduction
- CLS improvements from defined image dimensions and font loading fixes
Track business metrics alongside technical metrics. Conversion rate, revenue per session, and bounce rate should improve as performance improves. Backlinko’s analysis of page speed and search rankings also notes the organic traffic benefits of improved Core Web Vitals.
Set up regular performance monitoring—quarterly at minimum, monthly for high-traffic stores—to catch regressions before they accumulate.
Site speed optimization is technical work that compounds over time—fast stores get organic traffic advantages, higher conversion rates, and better paid media efficiency. CodingGeek’s e-commerce maintenance services include regular performance auditing and optimization for Shopify and WooCommerce stores, with documented before-and-after measurement for every engagement. Get in touch to start with a performance audit for your store.