Poc sports
Led frontend for a new e-commerce platform, from architecture to UI for a fast, modern customer experience.
Built the e-commerce frontend for POC Sports, a Swedish performance sports brand, from first commit to production. Headless architecture serving static pages across four global markets.
1,609 commits · 25 locale × currency combinations · 4 markets
Statically serving e-commerce across four markets
Most e-commerce sites are fully dynamic. POC Sports needed 25 locale and currency combinations with fast page loads on every continent, while keeping cart, checkout, and pricing dynamic per session.
What I built
Custom Centra API client with dual modes: token-less
STATICfor build-time and sitemaps, session-basedDYNAMICfor user-facing pages. Curried methods (method(config)(params)) made market config reusable everywhere.Multi-market static generation: pages pre-rendered per locale with
force-staticand 6-hour ISR. One build covers all 25 combinations.Edge middleware that creates a Centra session on first visit, detects market, language, and currency via IP geolocation, and sets the session cookie. It is the boundary between the static and dynamic layers.
Content layer: Sanity CMS with live preview and portable text, integrated into Server Components.
How it's built
Request → Edge Middleware (session + locale detection)
→ Static page from CDN (force-static, ISR)
→ Sanity CDN for content | Centra DYNAMIC for products
→ Zustand (UI state) + React Query (server state)Product pages fetch fresh on every request: pricing and stock must be real-time. A Result<T, E> type with ts-pattern enforces exhaustive error handling at every API boundary.
Decisions
ISR over full SSR: CDN-speed pages at the cost of 6-hour staleness. For a catalog that changes weekly, that is fine. QA uses
revalidate: 0so merchandisers see changes instantly.One dual-mode client over two separate clients: the
CheckoutApiHeaderservice detects context and sets the right auth headers. Consumers do not need to know which mode they are in.
Hard part: caching without serving stale prices
Static pages are fast, but a cached page showing the wrong price in the wrong currency is not ideal.
The solution split the problem into layers. Content caches via Sanity's CDN. Product data (price, stock) fetches fresh per-request using the session token, which carries market and pricelist. Metadata uses 24-hour ISR. A stale meta description never costs a sale. The middleware is the gatekeeper: it runs on every request, establishes the session, and writes market context into a cookie that downstream pages read.
What I'd do differently
On-demand ISR via webhook instead of time-based revalidation. A Sanity webhook triggering revalidateTag would give instant content updates with zero unnecessary cache misses. Six hours was a safe guess, not an optimal answer.
Today
The site is live at poc.com.