Shopify caching

How Shopify caching works and why AB Genius is built to work with it.

How Shopify caching works — and how AB Genius handles it

Shopify uses aggressive server-side caching to deliver fast page loads.

This is great for performance. It can also create confusion when you’re running A/B experiments.

What Shopify caches

Shopify caches storefront pages at the server level.

When a visitor requests a product page, Shopify often serves a cached version instead of rendering it from scratch. This reduces load times.

The result: the HTML delivered to visitors is typically identical. It’s the same cached page for everyone.

Why this matters for A/B testing

Some A/B testing tools rely on server-side rendering to deliver different experiences.

That approach conflicts with Shopify’s caching layer because Shopify serves the same cached HTML to everyone.

Tools that try to modify the page before it’s sent to the browser often fail on Shopify. Or they require bypassing caching, which slows the store.

How AB Genius solves this

AB Genius doesn’t fight Shopify’s caching. It works with it.

Experiments are delivered client-side through a Shopify Theme App Extension.

  • The cached page loads as normal, at full speed.

  • Then ab-live.js applies the correct variation for that visitor.

Price tests and anti-flicker

For price tests, the cached page loads with the original prices.

AB Genius swaps to the test prices before the visitor sees anything using anti-flicker.

Local assignment caching

Visitor assignment is stored in a browser cookie (ab_data) for one hour.

Within that window, AB Genius can apply the variation without making an API call.

What about Shopify’s CDN cache?

Shopify’s CDN caches static assets like images, CSS, and JavaScript.

AB Genius is loaded via Theme App Extensions, so it benefits from Shopify’s CDN caching like native theme assets.

Cart and checkout caching

Shopify handles cart and checkout differently.

For price tests, AB Genius uses Shopify’s Cart Transform Function.

Flow:

  1. When a visitor adds to cart, the test price is embedded in cart attributes.

  2. At checkout, the Cart Transform Function reads that data.

  3. Shopify applies the correct price server-side inside checkout.

This is checkout-safe regardless of cart or checkout caching.

Common questions

chevron-rightWill clearing my Shopify cache affect running experiments?hashtag

No.

Experiment data is stored in AB Genius and delivered via API. Clearing Shopify cache does not affect assignments, experiment state, or results.

chevron-rightWhy do I see the original price when I preview my own store?hashtag

AB Genius excludes admin sessions from experiments.

If you’re logged into Shopify, you won’t be assigned to any group.

Test in an incognito/private window to see the experiment as a real visitor.

chevron-rightDoes Shopify’s page caching cause visitors to see the wrong variation?hashtag

No.

Assignment is per-browser via cookies, not per-page-cache.

Each visitor gets their own assignment regardless of the cached HTML.

Last updated