> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cairnscript.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Staging & production

> Test drafts on your webflow.io staging site before they reach the live domain.

Cairn delivers different content depending on where the page is being viewed:

* **Production**: your custom domain gets the last **published** version of each script.
* **Staging**: your `*.webflow.io` staging domain gets the latest **saved draft**, with caching turned off so changes show up on the next reload.

So the normal workflow is: save, reload the webflow\.io site to test, and only **Publish** when it works. Publishing is what moves the draft to your live domain. Nothing reaches production from a save alone.

The publish panel in the editor shows both destinations for the current site: the staging domain and the production domain, each with its last-published timestamp.

## How Cairn detects staging

The loader request carries the page's domain, and Cairn treats it as staging when it matches any of these:

1. The site's **webflow\.io staging domain** (picked up automatically from Webflow).
2. Any **custom staging domains** you add in the site's settings (comma-separated; subdomains match too).
3. **Auto-detected staging hostnames**, if auto-detection is on for the site: `localhost`, `*.webflow.io`, `*.vercel.app`, `*.netlify.app`, and hostnames containing `-staging.`, `.staging.`, `.preview.`, `.test.`, or `.dev.`.

When Cairn can't tell what the domain is, it defaults to production, which is the safer direction.

<Warning>
  If you serve a real production site on a domain that matches an auto-detect
  pattern (say, a `.dev` TLD), add it as a Webflow custom domain or turn
  auto-detection off for that site so visitors don't get drafts.
</Warning>

## Development mode

Sites also have a **development mode** toggle. While it's on, Cairn adds a cache-buster to every script URL so edits show up right away on any domain. It's handy during a build-out, but leave it off the rest of the time so production stays fully cacheable.
