Shopify

Shopify Speed Optimization: How to Get a Sub-2 Second Load Time

A practical Shopify speed optimization guide covering Core Web Vitals, image compression, app audits, theme code cleanup, and how to hit sub-2s load times.

CG
CodingGeek Team
10 min read
Shopify Speed Optimization: How to Get a Sub-2 Second Load Time

Shopify Speed Optimization: How to Get a Sub-2 Second Load Time

Shopify speed optimization is one of those topics where the stakes are concrete and measurable. Google’s research is unambiguous: as mobile page load time goes from 1 second to 3 seconds, bounce rate increases by 32%. For e-commerce specifically, Portent’s industry data shows that conversion rates are highest at 0–2 second load times and drop sharply after that.

Getting a Shopify store to load in under 2 seconds on mobile requires deliberate effort. Shopify’s CDN and infrastructure give you a strong foundation, but every theme bloat element and third-party app script you layer on top chips away at that advantage. This guide shows you exactly where to look and what to fix.

Understanding How Shopify Performance Is Measured

Before optimizing, understand the metrics you’re targeting. There are two distinct measurement contexts:

Google PageSpeed Insights Score

Google PageSpeed Insights gives you a score from 0–100 and reports Core Web Vitals. The score is useful directionally, but it’s a lab test — it simulates performance on a specific device/connection profile and doesn’t represent your actual visitors.

Core Web Vitals (Field Data)

These are measured against real user experiences in Chrome browsers. The three signals Google uses in its ranking algorithm:

  • LCP (Largest Contentful Paint): Time until the largest visible element loads. Target: under 2.5 seconds
  • FID (First Input Delay) / INP (Interaction to Next Paint): Responsiveness to user input. Target: under 200ms
  • CLS (Cumulative Layout Shift): Visual stability as page loads. Target: under 0.1

Your Core Web Vitals data is visible in Google Search Console under Experience > Core Web Vitals. This is field data from real users — prioritize fixing issues flagged here above PageSpeed score improvements.

Step 1: Audit Your Installed Apps

This is almost always the highest-impact optimization available to Shopify stores. Every app you install has the potential to inject JavaScript, CSS, and external HTTP requests into every page of your storefront.

How to Identify App Impact

  1. Open your store in an incognito window
  2. Open Chrome DevTools (F12) > Network tab
  3. Reload the page and look at the waterfall
  4. Note every external domain loading resources — compare against your installed apps

A better method: use Shopify’s built-in speed report (Online Store > Themes > View speed report) which shows how your speed score compares to similar stores.

The App Audit Process

For each installed app, ask:

  1. Is this app actively being used?
  2. Does it load scripts on every page, or only where it’s used?
  3. What is the measurable revenue impact?

Remove any app you’re not actively using. Even deactivated apps sometimes leave JavaScript snippets in your theme files — check your theme’s theme.liquid file for orphaned <script> tags.

For apps you keep, check whether the developer has a setting to limit script loading. For example, a size chart app only needs to load its script on product pages — if it’s loading on the homepage and blog posts, that’s wasted load time on pages where it provides no value.

Step 2: Optimize Images

Images are typically the largest assets on any Shopify storefront and the most common source of LCP issues.

Format: Use WebP

Shopify automatically serves WebP images to browsers that support it (all modern browsers) when you reference images through Shopify’s CDN. However, this only applies to images uploaded to Shopify — images hosted externally (e.g., in app scripts, background images in CSS) won’t benefit.

Make sure your theme references images through Shopify’s Liquid image URL filters rather than hardcoded URLs.

Sizing: Use Responsive Images

Don’t serve a 2048×2048px image to a mobile user viewing a 375px wide screen. Shopify’s Liquid img_url filter supports size parameters. Your theme should be using the srcset attribute to serve appropriately sized images at different breakpoints.

If you’re using a premium theme, this is likely already implemented. Check by right-clicking an image on your store and selecting “Inspect” — you should see srcset attributes with multiple size options.

Compression Before Upload

Even with Shopify’s WebP conversion, uploading heavily compressed source files helps. Use Squoosh or TinyPNG to compress images before uploading. Target:

  • Product images: under 200KB (ideally 80–120KB)
  • Hero banner images: under 300KB

Lazy Loading

Images below the fold should use lazy loading — they shouldn’t download until the user scrolls toward them. Modern Shopify themes implement this with the loading="lazy" attribute. Verify your theme does this; if not, it’s a theme code change worth making.

Shopify speed optimization waterfall analysis

Step 3: Minimize and Defer JavaScript

JavaScript is the primary cause of poor INP and FID scores because it blocks the main thread during parsing and execution.

Identify Render-Blocking Scripts

In PageSpeed Insights, look for the “Eliminate render-blocking resources” opportunity. These are scripts loaded in the <head> that delay the initial render.

Defer Non-Critical JavaScript

Any JavaScript that doesn’t need to run before the page is interactive should be deferred or loaded asynchronously. In your theme’s theme.liquid, look for <script> tags without defer or async attributes and add defer where appropriate.

Note: some scripts (like Shopify’s cart API) need to load synchronously. Don’t blindly defer everything — test after each change.

Remove Unused JavaScript

If your theme includes JavaScript for features you’re not using (e.g., a built-in slider you’ve never activated), remove or conditionally load those scripts. This requires theme code editing but can meaningfully reduce JavaScript payload.

Step 4: Optimize Your Theme

Choose a Lightweight Theme as Your Foundation

The gap between Shopify themes’ performance is significant. Dawn (Shopify’s free theme) consistently scores 70–90 on mobile PageSpeed. Some older premium themes score in the 30–50 range.

If you’re on a slow theme, the most impactful thing you can do is switch to a faster one. This is a significant undertaking if you have heavy customizations, but the compound benefit to conversion rates often justifies it.

Minimize Liquid Code Complexity

Complex Liquid logic (deeply nested loops, excessive {% render %} calls) doesn’t typically cause the same kind of performance issues as JavaScript, but excessive DOM size and server render time can affect TTFB (Time to First Byte). Keep Liquid templates clean and avoid rendering unused sections.

Disable Unused Theme Features

Themes often include features that load resources by default. Common culprits:

  • Predictive search — loads significant JavaScript for the search autocomplete feature. If you’re using a third-party search app, disable the theme’s native predictive search
  • Video backgrounds — autoplay video on the homepage is almost always a performance killer
  • Animation libraries — some themes load AOS or GSAP for scroll animations; these add 15–30KB of JavaScript

Step 5: Configure Shopify’s Built-in Performance Features

Use Shopify’s CDN for All Assets

Shopify’s CDN (backed by Fastly) delivers assets from edge locations globally. Make sure all theme assets (CSS, JS, images) reference {{ 'file.css' | asset_url }} Liquid syntax to serve from the CDN rather than your store’s origin.

Enable Browser Caching Through Shopify

Shopify automatically sets cache-control headers for theme assets, so repeat visitors load cached versions. You can’t configure caching headers directly, but you can ensure you’re not breaking cache by avoiding cache-busting query parameters in your theme code.

Step 6: Reduce Third-Party Script Impact

Beyond apps, review other third-party scripts:

  • Google Analytics 4 — use Shopify’s native GA4 integration rather than manually adding gtag.js, as Shopify’s implementation is more efficient
  • Facebook Pixel — use the official Facebook & Instagram app rather than manually pasting pixel code
  • Live chat — if you use a live chat app, configure it to load after the page is interactive (most modern chat apps support this)
  • Heatmap tools (Hotjar, Microsoft Clarity) — load these only on pages you’re actively testing, not sitewide

Step 7: Test and Iterate

After each optimization, re-test with the same tools:

  1. Google PageSpeed Insights — test both mobile and desktop versions of your key pages (homepage, a product page, a collection page)
  2. WebPageTest — provides a filmstrip view and waterfall that PageSpeed doesn’t
  3. Chrome DevTools Performance tab — for diagnosing JavaScript execution bottlenecks
  4. Google Search Console — monitor field data trends over 28-day windows

Mobile performance is what matters for Google rankings. Don’t fixate on desktop scores.

Realistic Expectations

A stock Shopify store running Dawn with no apps can score 90+ on mobile PageSpeed. A store with a heavily customized premium theme and 10+ apps might score 30–50. The path to sub-2-second load times for a fully-featured store involves:

  1. Aggressive app auditing (often the biggest win)
  2. Image optimization across the catalog
  3. Theme code cleanup
  4. Strategic JavaScript deferral

Most stores can realistically get from a 30–40 score to a 60–75 score through self-service optimization. Getting to 80+ typically requires developer-level theme code work.


Shopify speed optimization is a technical discipline that rewards deep expertise. If your store’s performance is affecting conversions and you want an expert audit and implementation, CodingGeek’s Shopify development service includes comprehensive performance optimization — from app auditing to custom theme code refactoring. We’ll identify exactly what’s slowing your store down and fix it.

shopify speed optimizationcore web vitalsshopify performancepage speedshopify

Ready to grow your store?

Get a free quote from our team — no commitment required.

We'll respond within 24 hours. No spam, ever.