Storefront has been decoupled into micro-frontends with a dedicated commerce app and shared shell.

Read the architecture guide →

Rendering & Caching Strategy

Server versus client rendering boundaries, streaming SSR, component caching profiles, cache invalidation, and gateway interaction patterns.

ArchitectureReference

Purpose & Scope

This reference defines the rendering and caching architecture across Storefront, Commerce, and Backoffice. It establishes where Server Components, streaming SSR, component caching, and Client Components are used, how server-prefetched data hydrates the browser cache, and how cache invalidation operates across public and private surfaces.

Rendering and Data Hydration Flow

The visual below illustrates how initial page requests render on the server, dehydrate prefetched data into the client query cache, and hand off interactive mutations and streams through the API Gateway.

Loading graph...

Architectural Principles & Rules

  • Server-first rendering: Routes default to Server Components for initial layout, SEO metadata, and data prefetching. Client Components are pushed to interactive leaf islands (filters, forms, basket controls, and conversational AI).
  • Surface-level caching isolation: Storefront enables component-level caching for public catalog and editorial content. Commerce and Backoffice disable component caching entirely so personalized basket, checkout, order, and administrative views always render fresh per request.
  • Per-request server query isolation: Server rendering creates an isolated query client per incoming HTTP request and dehydrates settled and pending queries to the browser, preventing cross-user data leakage while avoiding client-side loading waterfalls.
  • Mutation-driven cache invalidation: Client mutations invalidate domain-scoped query keys upon success, while Backoffice pairs conditional reads with ETag preconditions to avoid serving stale edits.
Strict Prohibition on Caching Private Surfaces

Never enable shared component caching or static route caching on Commerce or Backoffice routes. User-specific basket, order, and staff data must always bypass shared server caches.

Patterns & Boundaries

Concern / SurfaceArchitectural ApproachResponsibility BoundaryKey Trade-off
Public Discovery (Storefront)Server-rendered pages with component caching and structured SEO metadataStorefront owns public cache lifetimes; Catalog API owns authoritative book dataBrief eventual staleness on public listings, traded for low latency and high throughput
Transactional Flows (Commerce)Dynamic per-request SSR with zero shared caching and client hydrationCommerce enforces uncached dynamic rendering; Basket API and Ordering API own live stateHigher per-request compute cost, required for strict user data privacy
Staff Operations (Backoffice)Dynamic SSR shell + live SSE dashboard updates + conditional ETag readsBackoffice owns interactive admin views; backend APIs enforce preconditionsConditional checks add header round-trips, preventing silent concurrent overwrites
Streaming & SuspenseRoute-level loading skeletons and streaming server boundariesRoute entrypoints define suspense fallbacks; feature slices render streamed contentRequires carefully designed skeleton layouts to prevent cumulative layout shift

Quality & Operational Impact

  • Fast Perceived Performance: Server prefetching with streaming hydration eliminates client-side fetch waterfalls on initial page load.
  • Zero Cross-User Leakage: Per-request server query clients and Commerce’s uncached rendering profile guarantee strict tenant and shopper data isolation.
  • SEO & Conversion: Static optimization and component caching on Storefront deliver fast Time to First Byte (TTFB) for search crawlers and shoppers alike.