Setting the file. One moment.
Subchapter 7.9
references/playbooks/ecommerce.mdMarkdown3 KBView on GitHub
Storefronts with cart, checkout, product catalogs. Often Stripe-integrated. Traffic skews toward catalog browsing (cacheable) and checkout (uncacheable).
Edge Requests dominate (catalog browsing, image asset traffic) → Image Optimization (product images) → Function Duration (cart/checkout APIs). ISR Reads matter when product pages use ISR.
revalidate (60s-3600s). Every image should go through next/image (or the framework equivalent). For Vercel-hosted storefronts, image cost can dominate everything else.Promise.all for independent calls to Stripe + inventory + tax services. Cite vercel-react-best-practices:async-parallel.'use client' to the leaf. Cart components are interactive, but the page wrapping them shouldn’t be. Hoist server-rendered parts upward; only the buttons/forms are client.<img src={product.imageUrl}> for hundreds of variants costs more than the rest of the bill combined. Always next/image.force-dynamic on the storefront homepage. Often added during development to test cart-state behavior, never removed. Audit ruthlessly.vercel-react-best-practices:async-parallel — parallelize Stripe/inventory/tax calls in checkoutvercel-react-best-practices:async-suspense-boundaries — stream the checkout shell, fill cart drawer latervercel-react-best-practices:bundle-defer-third-party — defer analytics (GA, Mixpanel) post-hydrationhttps://nextjs.org/docs/app/api-reference/components/image — for the catalog image fixhttps://vercel.com/docs/bot-management — for bot traffic on search/product routes