Next Commerce
Themes

Storefront CDN & Caching

Storefront leverages CDNs and many caching strategies to ensure fast performant user experiences for your end customers.

Use Network Domain while Building Themes

Always use the store network domain {store}.29next.store when developing themes to bypass full page caching and preview your latest updates.

The network domain bypasses the full-page cache. It does not, by itself, prove that a template lookup is fresh.

Asset CDN

All merchant uploaded media assets and theme assets are loaded from our CDN for the fastest performance.

  • Media - Links to uploaded media should always use the cdn.29next.store
  • Theme Assets - Theme assets should use the asset_url in templates which always generates a full CDN link on the storefront.

Full Page Caching

All pages on storefront are cached for 5 minutes to ensure popular pages are as fast as possible for customers and minimal impact on the overall platform load.

  • User is Anonymous (unauthenticated).
  • Domain is a merchant mapped domain.
  • Page is not dynamic, ie /cart/, /checkout/, /accounts/ do not use full page caching.

On the network domain or in an active preview session, append ?skip_cache=1 to bypass both the full-page and theme-template caches for that request. On a mapped production domain without a preview session, the parameter is ignored.

Template Caching

Themes use many templates ie layouts, partials, and assets that when compiled together create amazing customer experiences. Templates are cached in memory to reduce database queries when compiling templates into the full html response.

Each theme has a shared revision. Saving or deleting a template rotates that revision, so every application worker stops using its prior process-local or shared-cache entry. If a request must prove current database content, use the authorized skip_cache=1 flow above.

Network-domain responses include diagnostic headers:

HeaderMeaning
X-Theme-IdActive or previewed theme ID
X-Theme-TemplateEffective template selected after fallback
X-Theme-Template-CandidatesOrdered custom and generic candidates
X-Theme-Template-RevisionVersion of the selected template
X-Theme-RevisionShared theme revision used for cache keys
X-Theme-Cachelocal, shared, db, or bypass-db source

These headers are intentionally omitted from mapped production domains. For a custom product page, verify that X-Theme-Template names the intended product.<template-key>.html; a product URL slug does not select the template.

Theme assets use one canonical storage key per logical asset name. Replacing an asset updates that key and its versioned URL rather than accumulating suffixed filenames.

There are a few cases wherein a form on the frontend needs to use a {% csrf_token %} field to secure submission to the backend. The platform core JS will automatically replace {% csrf_token %} that are in cached versions of pages to ensure the forms still work.

It is advisable to not implement custom templates that require {% csrf_token %}, we recommend the Storefront GraphQL API instead.

On this page