All articles
E-commerceNovember 20, 2026 6 min read

Serving Shopify Collection Pages Under 200ms: A Caching Playbook

Collection pages are where browse intent turns into cart intent — or bounces. Here's the caching strategy we use to get Shopify category pages responding under 200ms at the edge, without fighting the platform.

Product pages get all the CRO attention, but collection pages are where most sessions actually live. If a shopper hits a category page and it takes 1.8 seconds to paint the first product grid, they're already scrolling slower, filtering less, and bouncing earlier. We've been chasing sub-200ms TTFB on Shopify collection pages across several storefronts this year, and the playbook below is what actually held up in production.

Why 200ms Is the Right Target for Collection Pages

Product detail pages are a destination — users arrived with intent and will tolerate a bit more latency. Collection pages are an exploration surface. People scan, filter, sort, paginate, and bounce back and forth. Every one of those interactions is a new request, and the perceived speed of the whole browse flow is roughly the sum of those TTFBs plus render.

We use 200ms as the edge-response budget for the HTML (or JSON, if headless), because it leaves roughly 600–800ms for the rest of the LCP budget on a mid-range Android on 4G. Miss that budget on collections and you'll see it in the funnel: filter usage drops, pagination depth drops, and add-to-cart rate from collection pages softens.

This isn't about Lighthouse scores. It's about whether the grid feels instant when someone taps a facet.

The Three Caching Layers That Actually Matter

On Shopify — Online Store 2.0 or headless — there are three layers worth engineering carefully. Everything else is noise.

1. Shopify's Own Full-Page Cache

On the native storefront, Shopify fronts everything with its own CDN and full-page cache. It's good, but it's also quietly fragile. The cache key includes things you'd expect (URL, currency, locale) and some you might not (certain cookies, customer login state, the ?variant= parameter on product URLs that some themes propagate into collection links).

Practical consequences:

  • Any Liquid block that renders based on customer drops you out of the shared cache for that request.
  • Appending tracking params like utm_* can still hit cache, but a surprising number of apps inject custom params that don't.
  • Section Rendering API responses are cached separately from the full page. If you re-render filters via sections, you're relying on a different cache behaviour than the initial load.

Before you build anything custom, instrument the cache. Look for the cf-cache-status or equivalent header on responses and log hit ratios per route. We routinely find storefronts sitting at 40–60% hit rate on collections when they could be at 90%+.

2. A CDN You Actually Control (Headless Only)

If you're on Hydrogen, Next.js with the Storefront API, or a custom Remix build, you own the cache. This is where the 200ms target becomes realistic — but only if you treat the Storefront API like a database you're deliberately shielding.

Our default pattern on Vercel or Cloudflare Workers:

// Collection page loader (Remix/Next-style)
export async function loader({ params, request }) {
  const url = new URL(request.url);
  const sort = url.searchParams.get('sort') ?? 'manual';
  const page = url.searchParams.get('page') ?? '1';

  const cacheKey = `collection:${params.handle}:${sort}:${page}`;

  const response = await fetchCollection(params.handle, { sort, page });

  return json(response, {
    headers: {
      'Cache-Control': 'public, max-age=0, must-revalidate',
      'CDN-Cache-Control': 'public, s-maxage=60, stale-while-revalidate=86400',
      'Vary': 'Accept-Encoding, X-Country',
    },
  });
}

The key decisions baked in:

  • Browser cache is zero. We don't want stale stock counts or price flashes on back-navigation. The CDN layer carries the weight.
  • s-maxage=60 means the edge serves fresh HTML for 60 seconds, then revalidates. For a collection with 1,000 sessions/minute, that's 999 cache hits.
  • stale-while-revalidate=86400 is the magic. If content goes stale, we serve stale immediately and refresh in the background. User never waits.
  • Vary on a custom country header, not Accept-Language, because Accept-Language fragments the cache into hundreds of variants.

3. GraphQL Response Caching

Even with edge HTML caching, you'll get cache misses — new URLs, long-tail sorts, bot traffic. On a miss, you don't want to hit the Storefront API cold if you can help it. We layer a short-lived KV or Redis cache in front of the GraphQL calls themselves, keyed by the hashed query + variables, with a TTL of 30–120 seconds depending on the collection's volatility.

This is the layer that gets you from "fast when cached" to "fast even on a miss".

The Faceted Filter Problem

Filters are where cache strategies die. A collection with 6 filter dimensions and 4 values each has thousands of possible URL combinations. You can't pre-warm all of them, and most will have zero traffic.

What we do instead:

  1. Canonicalise filter order in the URL. ?color=black&size=m and ?size=m&color=black should resolve to the same cache key. Do this in a middleware before the cache lookup, not in the loader.
  2. Serve the unfiltered collection from cache, filter on the client for the first interaction. The initial grid is instant; the filter applies in-memory against the already-loaded product list for small-to-medium collections (under ~200 products).
  3. For large collections, use the Storefront API's filters argument and accept that deep-filtered URLs will be cache misses. Mitigate with the GraphQL layer above, and don't bother pre-warming them.
  4. Exclude rare facet combinations from indexing. No reason for Google to crawl ?color=black&size=xs&material=linen&inseam=34. A clean robots directive keeps crawl budget on the URLs that actually convert.

When to Reach for Search-as-a-Service

If your merchandising team wants real-time inventory-aware filtering, AI-driven sort, or personalised ordering, you're past what the Storefront API will comfortably cache. At that point, pushing collection rendering through a dedicated search service (Algolia, Typesense, Meilisearch, or Shopify's own Search & Discovery with its API) and caching those responses becomes the better architecture. The tradeoff: you now have an index to keep in sync with Shopify's product catalogue, and webhooks become load-bearing infrastructure.

Invalidation Without Thundering Herds

The hardest part of this isn't getting the cache hit; it's purging without breaking everything. A naive setup looks like this: product updates in Shopify → webhook fires → purge every collection the product belongs to. Sounds fine, until a bulk price update fires 4,000 webhooks in 30 seconds and your origin gets hammered.

Two patterns that have saved us:

  • Debounce and batch webhooks. Hold incoming product-update webhooks in a queue for 5–10 seconds, deduplicate by product ID, then issue a single purge per affected collection. You lose a few seconds of freshness and avoid a stampede.
  • Soft purge via stale-while-revalidate. Instead of hard-purging the cache entry, mark it stale. The next request serves stale instantly, triggers a background refresh, and only one request hits the origin. Cloudflare and Fastly both support this; on Vercel you can approximate it by lowering s-maxage on tagged responses.

Tag-based purging — where you tag cached responses with collection:summer-2026 and purge by tag — is worth the setup cost. It's the difference between "purge 400 URLs" and "purge one tag".

What to Measure

If you take nothing else from this, instrument these four numbers per collection route, bucketed by cache status:

  • TTFB p50 and p95
  • Cache hit ratio
  • Origin GraphQL latency p95
  • Filter-interaction-to-paint time

Most teams track Lighthouse and Web Vitals and stop there. Those are output metrics. The ones above are the levers — and when the funnel moves, you'll know why it moved.

Where We'd Start

If you're inheriting a Shopify storefront today and collection pages feel sluggish, do this in order. First, log cache status headers for a week and find out what your actual hit ratio looks like — most teams are shocked. Second, audit which Liquid sections or app blocks are forcing uncached renders and either remove them or move them to client-side hydration. Third, if you're already headless, add CDN-Cache-Control with stale-while-revalidate before you touch anything else; it's the single highest-leverage change. Only then start thinking about GraphQL caching, canonical filter URLs, or search-as-a-service.

The 200ms target isn't exotic. It's just the result of taking caching seriously at every layer instead of hoping the platform handles it. If you want a second pair of eyes on your storefront architecture, our commerce engineering team does this kind of audit regularly.

#Shopify#Performance#Caching#Headless Commerce

Want a team like ours?

72Technologies builds production software for the kind of teams who actually read this blog.

Start a project