Web performance consultant for Medusa.js

Optimize web performance on Medusa.js stores

Medusa.js is the most modular headless commerce framework on the market, but a large catalog + synchronous workflows + a loose Next.js storefront drives TTFB up and breaks Core Web Vitals. I work on both the Medusa backend and the storefront to deliver a fast, stable e-commerce experience.

100% satisfied clients Data 2023-2026 8+ years XP 35+ clients partnered
View my client cases

They trust me

CHANEL
DIOR
Decathlon
April Moto
SiriusXM
Make Up Forever
Camif
RIMOWA
Jimmy Fairly
Wecasa
Chronovet
CHANEL
DIOR
Decathlon
April Moto
SiriusXM
Make Up Forever
Camif
RIMOWA
Jimmy Fairly
Wecasa
Chronovet

Medusa.js symptoms calling for an audit

Poorly-framed Medusa.js stores show characteristic bottlenecks on the pricing engine, synchronous workflows, and the Next.js storefront.

💰 API TTFB drifting on product listings

The pricing engine resolves rules on every product card without cache. Redis cache on stable prices (per region/currency) drops catalog endpoint TTFB 40 to 70%.

🔁 Postgres N+1 on variants and options

Without targeted relations, loading a product triggers cascading queries on variants, prices, inventory, images. The pg_stat_statements profile exposes the patterns. Targeted select + missing indexes stabilize catalog queries.

📧 Synchronous workflows on order creation

Payment capture + confirmation email + ERP sync + search index in sync adds 500ms to 2s to response time. Splitting via Subscribers + Redis events moves everything that can move out of the critical flow.

🔎 Meilisearch or Algolia index rebuilt synchronously

Every product update triggers an index rebuild in the admin flow. Moving to an async queue (BullMQ or Redis Streams) frees the backend and avoids CPU spikes on every catalog import.

📦 Next.js storefront without ISR or disciplined RSC

revalidate: 0 everywhere, full hydration, payment SDK loaded on the home. Apply ISR on catalog + product pages, RSC + streaming, dynamic import on payment SDKs. Storefront LCP drops below 1.5s.

🖼️ Unoptimized product images, no CDN

Images served as JPEG from the bucket without transformation. Add a Sharp pipeline + AVIF/WebP, fronting CDN (Bunny, Cloudflare, Vercel) with long cache, strict responsive sizes. Catalog LCP stabilizes.

Medusa.js optimization methodology

4 steps to transform your performance

1
Step 1

1. Postgres and Medusa logger profiling

Identify slow queries via pg_stat_statements, N+1 on variants/prices/inventory, overly synchronous workflows. Map most-called API endpoints and their storefront LCP impact.

2
Step 2

2. Pricing and catalog optimization

Redis cache on stable price calculations, targeted select + relations on listings, missing Postgres indexes (region_id, customer_group_id), cursor pagination on very large catalogs.

3
Step 3

3. Workflow and event splitting

Critical steps synchronous (payment, stock), secondary steps async via Subscribers + Redis events (emails, ERP sync, search index). Meilisearch/Algolia index rebuild on a dedicated queue.

4
Step 4

4. Next.js storefront and CDN

Switch to ISR on catalog and product, RSC + streaming on rich pages, dynamic import of payment SDKs, Sharp + AVIF image pipeline, fronting CDN with long cache on assets and cacheable HTML.

Mission commitments

-50% typical Medusa API TTFB
Pricing Redis cache applied
Async workflows split
Continuous stack profiled on every release
FAQ

Frequently asked questions

Is Medusa.js v2 production-ready?
Yes, on properly framed stacks. v2 has been in production on several significant stores since late 2024. Performance work-streams are stabilized (Module Architecture, Workflow Engine, Links). On a greenfield project, it's the default base — on a v1 to v2 migration, the audit identifies which custom modules need a refactor.
Which DB for Medusa: Postgres only, or +Redis?
Postgres is required (the main data store). Redis is technically optional but practically essential as soon as you pass a few hundred orders per day: price cache, sessions, event bus, workflow queues. Without Redis, the pricing engine and event bus hit Postgres directly and TTFB drifts quickly.
Do you have to use a Next.js storefront?
No. Medusa exposes a REST Store API consumable from any frontend (Next.js, Remix, Astro, Nuxt, native mobile). The official starter is Next.js, and that's what I recommend on most projects for the maturity of the React e-commerce ecosystem. On a content + commerce project, an Astro storefront remains relevant.
How are your Medusa.js engagements structured?
My Medusa engagements run as continuous sprints. The initial sprint frames the architecture (modules, workflows, Redis cache, storefront) and the roadmap. Following sprints work backend + storefront optimizations with before/after measurement. An active Medusa store evolves with every release — catalog debt and storefront JS debt rebuild if nobody watches them.

Drop your Medusa.js TTFB

Pricing engine cached
Async workflows
Optimized Next.js storefront
100% satisfied clients
Data 2023-2026
Testimonials

What my clients say

Excellent work.
Paul has significantly improved the site's speed and perfectly aligned it with Google's recommendations.
Professional, thorough, and efficient, I highly recommend.

Nicolas - April Moto

Digital & E-commerce Director

We are very satisfied with Paul's work. He is quick, available, and particularly effective. Since his arrival, very good results have been observed, both in terms of performance and responsiveness. A real asset for our team.

Léo - Luxury brand

E-commerce Product Owner

I don't know if we've said it enough.
But if you want to improve your loading speed,
Make Google happy and get your Core Web Vitals in the green,
Contact Paul Delcloy.

Florian Darroman - Les Makers

Co-founder

Medusa.js, modular headless commerce with performance to frame

Medusa.js has established itself as the open-source alternative to Shopify for teams that want to own their e-commerce stack end-to-end. Version 2.0 rewrites the core into a modular architecture (Modules, Workflows, Links), with a strict backend / storefront separation — typically a Next.js storefront calling the Medusa API through the Store API or Server Actions.

That modularity is a design strength, but opens performance debt angles that compound as soon as the catalog passes a few thousand products or traffic climbs. The web performance optimization angle on Medusa is multi-layer: Postgres profiled on catalog and pricing queries, Redis configured for cache and events, workflows split between sync and async, Next.js storefront on ISR or streaming with a strict JS budget.

Pricing engine and catalog, first work-stream

Medusa's pricing engine resolves complex rules (price lists, currencies, customer groups, region, sales channel) on every request. On a product listing rendering 50 cards with prices, the calculation can trigger cascading queries if relations aren't preloaded correctly.

Diagnosis via the Medusa logger and Postgres profiler (pg_stat_statements, EXPLAIN ANALYZE) exposes slow queries immediately. Moving to targeted select + relations instead of full fetch, plus a Redis cache on stable price calculations, drops API TTFB 40 to 70% on catalog endpoints. On high-SKU stores, it's often the lever that gets the storefront green on LCP.

Workflows and events, async by default

Medusa 2.0 introduces the Workflow Engine that orchestrates multi-step operations (order creation, refund, payment capture) with idempotency and compensation. It's powerful, but a poorly-split workflow runs steps synchronously that should be async: confirmation emails, ERP sync, Meilisearch or Algolia index updates.

Refactoring — critical steps synchronous (payment capture, stock), secondary steps async via Subscribers + Redis events — drops perceived order creation latency by hundreds of ms. Same logic as Laravel queues, but carried by Medusa's workflow primitives.

Next.js storefront, the Core Web Vitals battleground

The storefront is typically separated from the backend (Next.js, Remix, Astro). That's where LCP, CLS and INP — what Google measures — actually play out. Classic traps: revalidate: 0 everywhere instead of ISR on catalog pages, full hydration instead of RSC + streaming, Stripe or PayPal SDK loaded on the home when it's only useful at checkout.

The storefront audit covers JS bundle (250 KB gzip target on the home), product images (AVIF format, correct sizes, lazy below the fold), CDN cache on product pages, and precise RSC/Client splitting. On a properly framed Next.js Medusa storefront, you hold sub-1.5s LCP and sub-200ms INP even on 3G mobile.