Skip to main content

Always Online

Always Online keeps your site reachable when your origin goes down. Instead of returning an error, the CDN serves the stale cached copy of a page it last fetched successfully. It's configured in the General tab via the always_online general setting.

How it works

When Always Online is enabled and a request would otherwise fail at the origin, the CDN checks whether it has a previously cached response for that URL. If it does, it serves that stale copy. The visitor sees the last-known-good content rather than an error page.

Settings

{
"always_online": {
"enabled": true,
"codes": ["error", "timeout", "500", "502", "503", "504"]
}
}
FieldTypeMeaning
enabledbooleanTurns Always Online on.
codesstring[]The failure conditions that trigger serving stale content.

Trigger codes (the allowlist)

The codes list (shown as selectable chips in the panel) is restricted to exactly these values:

CodeTriggers on
errorA generic origin error.
updatingThe origin is mid-update / unavailable.
timeoutThe origin did not respond in time.
invalid_headerThe origin returned a malformed header.
500Internal Server Error.
502Bad Gateway.
503Service Unavailable.
504Gateway Timeout.
403Forbidden.
404Not Found.
429Too Many Requests.

Only values from this list are accepted.

:::tip A sensible starting point The error, timeout, 500, 502, 503, and 504 conditions cover the cases where your origin is genuinely down or overloaded. Add 429 if you want to ride out rate-limit spikes with cached content. :::

Understand the trade-off

Always Online trades freshness for availability: during an origin outage, visitors get a copy that may be out of date rather than an error. That's almost always the right call for marketing pages and content sites, but think carefully before treating these as failures:

:::warning Be deliberate with 403, 404, and 429 Including 403, 404, or 429 makes the CDN serve a stale cached page when the origin returns those statuses. If those responses are sometimes legitimate (a real "not found", an intentional block, or a deliberate rate limit), Always Online can mask them by serving old content. Only add them if you specifically want to override those responses with the last cached copy. :::

:::info Stale-but-up needs a prior cache Always Online can only serve content it has previously cached. A URL that was never successfully fetched has no stale copy to fall back to, so the failure passes through as an error. :::

Saving

Always Online is part of the general-settings blob and is saved with the full object — see Browser caching & query strings for the GET-then-PUT-the-whole-object workflow that prevents overwriting other settings.

curl -X PUT "https://api.paradarum.com/api/property/42/general-settings?accountId=123" \
-H "X-API-Key: pdm_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"always_online": { "enabled": true, "codes": ["error", "timeout", "500", "502", "503", "504"] },
"browser_caching": { "mode": "override", "ttl": 3600 }
}'