Shopify Store Speed Optimization: A Practical Guide for Developers
A practical guide to making Shopify stores faster: measuring real pages, fixing oversized images, auditing apps, scoping theme code, and handling fonts, videos, and third-party scripts.

Yash Nandvana
Full Stack Developer

Introduction
A slow Shopify store does not announce itself with an error message. It just quietly loses visitors. Someone clicks a product link, the page takes a few seconds to become usable, and they leave before they ever see the price. No crash, no bug report — just a sale that never happened.
Speed is not a vanity metric for a store. It affects how a page feels, how search engines judge it, and whether a visitor trusts the store enough to check out. The good news is that most Shopify speed problems come from a small set of causes: oversized images, too many apps, unscoped code, and pages that load everything at once whether the visitor needs it or not.
This guide covers how to find what is actually slow, and how to fix it in order of impact. It is written for developers working on Online Store 2.0 themes, but the principles apply to any Shopify store. It does not promise a specific score — scores vary by device, network, and page — it gives you a repeatable process that makes real pages measurably faster.
1. Measure Before You Optimise
Optimising without measuring is guessing. Before changing anything, record a baseline for the pages that matter most: the homepage, a collection page, and a product page. Those three pages cover most of a store's traffic, and they usually have different problems.
Useful, free ways to measure:
Record three numbers for each key page: the time to first contentful paint, the time to largest contentful paint, and the total page weight. Write them down. After each fix, measure again. If a change does not move one of those numbers, it was not an optimisation — it was activity.
One warning about scores: a perfect lab score on a page with no products, no images, and no apps proves nothing. Optimise the real pages, with real content, and judge the result on those pages.
2. Images: Usually the Biggest Win
On most Shopify stores, images are the largest single contributor to page weight. Product photos, banners, and collection images are often uploaded at full camera resolution and then rendered at a fraction of that size. Fixing images alone often cuts page weight in half.
Serve the size you actually render
Shopify's image_url filter is the main tool. Request the width you render, not the original:
{{ product.featured_image | image_url: width: 800 | image_tag: alt: product.title }}If an image renders at 800 pixels wide on desktop and 400 on mobile, serve those sizes. Do not serve a 4000-pixel original and let the browser shrink it. The browser still downloads the full file.
For responsive images, use srcset so the browser can pick the right size for the device:
{{ image | image_url: width: 400 | image_tag: srcset: image_srcset, alt: image.alt }}In practice, theme image helpers handle much of this. The developer's job is to make sure the widths requested match the layout, and that no template is requesting the original image by accident.
Choose the right format and compression
Shopify serves images in modern formats automatically when the browser supports them, so you rarely need to convert formats by hand. What you do need to control is the source: upload images that are already reasonably sized and compressed, not multi-megabyte originals straight from a camera or a design tool. A banner that will render at 1600 pixels wide does not need to be uploaded at 6000 pixels.
Lazy-load everything below the fold
Images in the first viewport — the hero, the first product image — should load immediately. Everything else should load lazily, so the browser does not download images the visitor has not scrolled to yet:
{{ image | image_url: width: 800 | image_tag: loading: 'lazy', alt: image.alt }}This one attribute, applied consistently to below-the-fold images, is often worth more than a week of micro-optimisations elsewhere. Check that your theme actually applies it: many themes lazy-load product grid images but forget collection banners, blog images, or section images added later.
3. Apps: The Hidden Weight
Every installed Shopify app can add JavaScript, CSS, or network requests to the storefront — even on pages where the app's feature is not used. A store with twenty apps can easily load more third-party code than theme code.
Audit apps in three steps:
A useful rule: an app should earn its place on every page it loads on. An app that adds a script to the whole store but is only used on one page should either be scoped to that page, or replaced. Many apps load globally by default, and merchants never notice.
Also check for duplicate functionality. Two review apps, two pop-up apps, or two analytics apps running at once is more common than it should be, and each one adds its own weight.
4. Theme Code: Keep It Scoped and Lean
Theme code causes speed problems in predictable ways. The fixes are mostly about discipline, not cleverness.
Load section code only where it is used
Online Store 2.0 sections can carry their own CSS and JavaScript, loaded only when the section is used on a page. Use that. Code that lives in a global stylesheet or a global script loads on every page, even pages that never use it. Moving section-specific code into {% stylesheet %} and {% javascript %} in the section file is a straightforward win, and it is one of the main advantages of sections over global assets.
Do not load a library for one feature
A full carousel library for a three-slide banner, a heavy animation library for a fade-in, or a date library for formatting one date is almost never worth the download. Native CSS and a few lines of JavaScript handle most storefront interactions, and they do it faster and with fewer failure modes.
Avoid render-blocking surprises
Scripts and stylesheets in the document head block rendering until they load. Keep the head lean: critical CSS inline or early, non-critical scripts deferred, and third-party scripts loaded asynchronously where possible. If a script must run before the page renders, it should be small and necessary — not a tracking script that could wait.
Clean up dead code
Themes accumulate dead code: sections that are no longer used, snippets that are no longer rendered, CSS for layouts that were removed months ago. Dead code still downloads, still parses, and still confuses the next developer. When a section is removed from all templates, remove its file too, after checking that no template still references it.
5. Liquid and Rendering: Fewer Requests, Less Work
Liquid itself is fast, but the way templates use it can create unnecessary work.
{% render %} instead of {% include %}. The older include tag shares variable scope in ways that cause subtle bugs and extra work. render is isolated, predictable, and the current standard.These are not exotic optimisations. They are the difference between a product grid that renders in milliseconds and one that renders noticeably slower because it does ten times the work it needs to.
6. Fonts, Videos, and Third-Party Scripts
After images and apps, the next most common culprits are fonts, videos, and third-party scripts.
Fonts
font-display: swap. Without it, text can stay invisible while a font loads. With swap, the browser shows fallback text immediately and swaps in the real font when it arrives. Visitors can read the page while fonts load, which is the point.Videos
Third-party scripts
7. Caching, CDN, and What Shopify Already Handles
It is worth knowing what you do not need to fix, because Shopify already handles it:
image_url, Shopify serves an optimised version. Your job is to request the right size, not to build your own image pipeline.What Shopify does not handle for you is the content of your pages: how many images you put on them, how many apps you install, how much code you load, and how your Liquid is written. That is where developer work matters, and it is where this guide focuses.
8. A Practical Optimisation Checklist
Work through this list in order, measuring after each step. Stop when the key pages are fast enough for real visitors — perfection on a lab score is not the goal.
font-display: swap, preload only the critical font.render.Common mistakes, and the fix for each:
| Symptom | Likely cause | Fix | |
|---|---|---|---|
| Page weight over several megabytes | Full-size original images | Serve rendered sizes with image_url | |
| Slow first paint on mobile | Too many head scripts and fonts | Defer scripts, limit font weights | |
| Page feels slow but lab score is fine | Third-party scripts on real devices | Audit apps and scripts, test on a real phone | |
| Speed regressed after a theme change | New app or global code added | Diff the change, scope code to where it is used | |
| Images load all at once | Missing lazy loading | Add loading: 'lazy' below the fold |
9. When Speed Work Stops Paying Off
There is a point of diminishing returns. Once key pages load quickly on a real phone, further lab-score chasing usually means removing features visitors actually use, or rewriting working code for a marginal gain. That trade is rarely worth it.
A better use of time at that point is content and conversion work: clearer product pages, better photography, simpler checkout steps, and honest, useful information. Speed gets visitors to the page. What is on the page is what makes them buy.
Conclusion
Shopify store speed is not a mystery, and it is not a single fix. It is the sum of ordinary decisions: image sizes, app choices, scoped code, font discipline, and lazy loading. Measure the real pages, fix the biggest contributor first, measure again, and repeat.
Most stores do not need a rebuild to get faster. They need an audit, a few removals, and a habit of checking speed when something new is added. Do that, and the store stays fast — not just on the day it is optimised, but on every day after.
Next Recommended Reads

Yash Nandvana• Full Stack Developer
Full Stack & Shopify Developer building scalable web apps, developer tools, and AI solutions.
Learn more about YashRelated Articles
Shopify Webhooks: A Complete Guide for Developers
A comprehensive, production-tested guide to Shopify webhooks: HMAC signature verification, raw body handling, idempotency with Redis, queue architecture, and local testing.
Shopify GraphQL Admin API: A Practical Guide for Developers
A comprehensive, production-oriented guide to Shopify's GraphQL Admin API: queries, mutations, pagination, rate limit cost calculation, userErrors checking, and bulk operations.
How to Build a Custom Shopify Section with Liquid: A Step-by-Step Guide
A practical, step-by-step guide to building a merchant-editable custom Shopify section with Liquid: schema settings, repeatable blocks, presets, scoped CSS, and the mistakes that break sections.
