Hydrogen vs Next.js for Shopify Headless: A Teardown After Three Builds
We've shipped the same storefront architecture on both Hydrogen and Next.js for Shopify clients. Here's where each one wins, where each one hurts, and the decision tree we now use before writing a single line of code.
We've now shipped three serious Shopify headless storefronts in the last 18 months — one on Hydrogen, two on Next.js — for clients ranging from a 200-SKU beauty brand to a mid-market electronics retailer doing eight figures a year. The framework question kept coming up in every kickoff, and the honest answer is: it depends, but not on the things most blog posts talk about.
This is the teardown we wish existed when we started. No marketing copy, no "both are great" cop-out.
The actual decision isn't about performance
Both frameworks can hit sub-2s LCP on product pages. Both support streaming SSR. Both talk to the Storefront API over GraphQL. If someone tells you Hydrogen is "faster than Next.js" or vice versa, they're selling something.
The real axes that matter in 2026 are:
- Hosting lock-in and cost at scale
- Caching model and how aggressively you can tune it
- Team familiarity and hiring pool
- How much of the storefront is "not Shopify" (CMS, loyalty, B2B portals, custom search)
- Checkout strategy — are you using Shopify's hosted checkout or Checkout Extensibility?
Let's go through each.
Hosting: Oxygen is a feature and a cage
Hydrogen deploys to Oxygen, Shopify's edge runtime, for free when you're on a paid Shopify plan. That's genuinely useful. You get edge rendering in ~100 locations, zero hosting invoices, and the deploy pipeline is a single shopify hydrogen deploy command. For a brand doing $2M–$10M/year, this removes an entire vendor relationship.
The cage: you can't leave Oxygen without rewriting your caching layer. Oxygen's cache API, the sub-request caching built into Hydrogen, and the createStorefrontClient helper are all tied to the Workers-style runtime. Port Hydrogen to Vercel or Cloudflare directly and you lose the parts that make it feel magical.
Next.js, by contrast, runs anywhere. Vercel is the happy path, but we've shipped Next commerce to AWS (via SST), Cloudflare Pages, and self-hosted Node on a client's existing Kubernetes cluster. For enterprise clients with procurement rules, this flexibility isn't optional.
Cost reality check
On one Next.js + Vercel build last year, a flash sale pushed us to roughly $1,800 in function invocations for a single weekend. We've since moved image optimization to Cloudflare and tightened ISR, but it's a real line item. Hydrogen on Oxygen would have cost zero extra for the same traffic — it's included in the Shopify plan.
If your merchant is price-sensitive and doesn't need multi-CMS orchestration, Oxygen wins on TCO. Full stop.
Caching: sub-request vs route-level
This is where the frameworks diverge philosophically.
Hydrogen caches individual Storefront API calls. You decorate each query with a cache policy:
const {product} = await storefront.query(PRODUCT_QUERY, {
variables: {handle},
cache: storefront.CacheLong(), // 1h fresh, 24h stale
});
That's it. The response is cached at the edge, keyed by the query and variables. Different queries on the same page can have different TTLs — product data stays fresh for an hour, nav menu for a day, inventory for 30 seconds.
Next.js caches at the fetch or route level, via revalidate and tag-based invalidation:
const res = await fetch(STOREFRONT_URL, {
method: 'POST',
body: JSON.stringify({query, variables}),
next: {revalidate: 3600, tags: [`product:${handle}`]},
});
Both work. The Next.js model is more flexible for complex invalidation — we can hit revalidateTag('product:xyz') from a Shopify webhook and surgically bust just that product. Doing the equivalent on Hydrogen requires either waiting for TTL expiry or using a soft-purge pattern with cache keys you bump manually.
For a catalog of 50,000 SKUs where merchandisers update products hourly, Next.js's invalidation story is cleaner. For a catalog of 500 SKUs where "stale for an hour" is fine, Hydrogen is simpler and you'll write less code.
DX and the "Shopify-shaped" problem
Hydrogen ships with components that assume a Shopify data shape: <Money>, <Image> wired to Shopify's CDN, <ProductProvider>, cart hooks that mirror the Storefront Cart API. If your product page looks like a Shopify product page, you'll be productive in a week.
The moment you add a second data source — say, a Sanity CMS for editorial content, Algolia for search, and a custom loyalty backend — Hydrogen's abstractions start getting in the way. We ended up bypassing <ProductProvider> entirely on one build because the client's product model had nested configurators that didn't map cleanly to Shopify variants.
Next.js gives you nothing commerce-specific, which sounds bad until you're building something that isn't 90% Shopify. You compose it yourself. For a storefront where Shopify is just the checkout and inventory system and everything else lives elsewhere, Next's blank-slate approach is actually faster.
The Remix question
Hydrogen is built on Remix (now folded into React Router 7). If your team already knows Remix loaders and actions, Hydrogen feels native. If your team is deep in Next.js App Router with Server Components and Server Actions, the mental model shift is non-trivial. We've seen this trip up senior engineers more than we expected — the loader / action split versus RSC is a real paradigm difference, not a syntax change.
SEO and rendering
Both do SSR. Both can emit proper structured data for products. Both handle canonical URLs and hreflang if you set them up. Neither gives you SEO for free.
One real gotcha: Next.js App Router's default is dynamic rendering unless you explicitly cache. We've audited two headless storefronts (not ours) where the engineering team assumed pages were static and they were in fact re-rendering on every request, nuking their Core Web Vitals and their bill. Hydrogen's model makes this harder to get wrong — caching is explicit per query and visible in code review.
Checkout: the part everyone forgets
Both frameworks hand off to Shopify's hosted checkout by default. That's fine. It's PCI-compliant, battle-tested, and with Checkout Extensibility you can customize it meaningfully without going headless on checkout itself.
If you're planning to build a fully custom checkout using the Storefront API's cart mutations and the new checkout kit, be aware: you're taking on PSD2, SCA, tax calculation edge cases, and fraud screening yourself. We've talked two clients out of this in the last year. The juice isn't worth the squeeze unless you have a very specific B2B or subscription flow that Shopify's checkout genuinely can't handle. More on how we approach this in our e-commerce engineering services.
Our decision tree
After three builds, here's the flowchart we actually use:
- Is the merchant on Shopify Plus and happy with it? If no, stop — go back and ask if headless is the right move at all.
- Is Shopify 80%+ of the data model? If yes, lean Hydrogen. If no, lean Next.js.
- Does the client already have a preferred host (AWS, Azure, Cloudflare)? If yes and it's not Oxygen-compatible, Next.js.
- Does the team have existing Next.js or Remix expertise? Match the framework to the team. Retraining is six weeks of lost velocity minimum.
- Is there a complex invalidation story — frequent price changes, flash drops, inventory syncing from an ERP? Next.js with tag-based revalidation.
- Is budget tight and the storefront relatively simple? Hydrogen + Oxygen. You'll save real money on hosting.
Where we'd start
If you're scoping a new headless Shopify build this quarter, don't start with the framework. Start by writing down every data source that isn't Shopify, every third-party service that touches the cart or customer, and every SLA you've committed to around freshness. Then pick.
For most mid-market brands with a straightforward catalog, Hydrogen on Oxygen is the faster, cheaper path to launch and we'd choose it. For anything with a real CMS, a custom search layer, or non-Shopify backends in the critical path, Next.js on Vercel or Cloudflare gives us room to breathe — and room to leave if the hosting bill ever gets ugly.
If you want a second opinion on an in-flight headless build, we do architecture reviews — details on our blog and services page.
Want a team like ours?
72Technologies builds production software for the kind of teams who actually read this blog.
Start a projectKeep reading
Why Your Shopify LCP Is Stuck at 3.2s (And the Six Fixes That Actually Moved It)
A field report on dragging Shopify product page LCP from the mid-3s into the low-2s. The usual advice doesn't cut it — here's what actually worked across three merchants in 2025.
WhatsApp Commerce in LATAM: What Actually Moves Revenue vs What Just Looks Good in Demos
We've shipped WhatsApp commerce flows for stores in Mexico, Colombia, and Brazil. Here's what actually converts, what the Meta sales deck won't tell you, and the integration patterns that survive contact with real customers.
Shopify Checkout Extensibility Migration: What Breaks and What Doesn't
Shopify's checkout.liquid sunset forced every Plus merchant onto Checkout Extensibility. Here's what actually breaks during migration, what doesn't, and the patterns that held up for us in production.
