Why Your Site Is Fast
Overview
Marketplace is built to deliver fast page loads and responsive browsing across devices. Pages render at the edge, pages and queries are cached close to the shopper, and interactive updates flow through a persistent session connection.
Server-side rendering (SSR)
When a shopper requests a page, Marketplace generates full HTML on the server and sends it to the browser already complete.
What this changes for the shopper:
- The page displays immediately after the response arrives.
- The browser does not wait for JavaScript to download and run before showing primary content.
SSR runs inside a Cloudflare Worker at the edge.
Edge rendering close to the shopper
Marketplace runs on Cloudflare’s global network.
When a shopper requests a page, the request is handled by a Cloudflare datacenter near that shopper. This reduces latency for every market.
Layered caching
Marketplace uses multiple caches to keep response times low while still serving up-to-date content.
Page-level cache
Fully rendered HTML pages are cached at the edge.
When a cached page is served, the response arrives quickly because the edge returns the rendered page without generating it again.
Content cache with targeted purging
When content is published in Sanity, the Query Composer identifies which cached queries are affected and purges only those.
This keeps the rest of the cache warm and supports high cache hit rates even on sites that publish frequently.
Inventory cache
Vehicle search and filter results are cached with a one-hour TTL per dealer index.
Cache is purged automatically when inventory is re-indexed after a DMS sync so shoppers see current inventory.
Asset cache
Images, fonts, stylesheets, and JavaScript are cached with long TTLs via Cloudflare’s CDN.
ERS WebSocket tunnel
After the initial page load, Marketplace establishes a persistent WebSocket connection between the shopper’s browser and Auto Genius infrastructure for the duration of the session.
A persistent tunnel supports real-time updates without full reloads, including:
- Navigation between pages with content swapped in over the tunnel
- Infinite scroll batches loaded as the shopper scrolls
- Filter updates with updated results and counts
- Real-time content updates such as pricing or availability changes without a page refresh
- Deferred initialization of tools such as GTM, New Relic, Rudderstack, chat tools, and fonts after the page renders
SPA-style navigation without reloads
Internal navigation is handled through ERS.
When a shopper clicks an internal link:
- ERS intercepts navigation before the browser performs a full reload.
- The new page content is fetched or served from a prefetch cache.
- Only the parts that change are updated, including the main content area, head metadata (title, description, canonical URL, JSON-LD), and layout styles.
- Shared elements like header, footer, fonts, and global scripts are not re-downloaded.
The URL updates via the History API and Back navigation works normally.
Prefetching
Marketplace prefetches pages so clicks resolve quickly.
Prefetch mechanisms:
- Hover prefetch on desktop
- Intersection prefetch using IntersectionObserver on mobile and desktop
On inventory grids, VDPs for visible cards are prefetched as the shopper browses.
Prefetch respects the saveData preference and does not run on limited data connections.
Module hydration
Pages render as static HTML first.
Interactive modules are marked for hydration and then activated on the already-rendered HTML. This adds interactivity without a full rerender.
Result:
- Shoppers see fully rendered content immediately.
- Interactivity is layered on as JavaScript attaches behavior to the existing markup.