Hydrogen is fast — until you ship to prod and discover the three gotchas every team hits.
1. Cookie size on edge
Shopify's default cart cookie can balloon past Cloudflare's 4KB header limit when you add line-item attributes. Trim it before deploy.
2. Cart hydration
The default useCart hook re-fetches on every navigation. Pin it to a route segment, not the root layout.
3. The SEO trap
Hydrogen renders product pages on demand. Without a canonical sitemap.xml + Open Graph passthrough, Google indexes your fallback shell. We learned this once. Never again.
// Trim the cart cookie before it reaches the edge.
export function trimCart(cart: Cart): Cart {
return {
...cart,
lines: cart.lines.map(({ attributes, ...line }) => line),
}
}Without a canonical sitemap, Google indexes your fallback shell.
Caching Medusa: What to Cache, Where, and What Never To
Four cache layers, one rule about carts, and the invalidation strategy that stops a price change taking twelve hours to appear.
Search in Medusa: Algolia, Meilisearch and Keeping the Index Fresh
Database search stops working sooner than you expect. Choosing an engine, building the index, and the sync strategy that survives a bulk import.
Scaling Medusa: What Breaks First and How to Fix It
Traffic does not break Medusa — the database does, then the workers, then the catalog queries. The bottlenecks in the order you will meet them.



