Learn how Always Online keeps a limited version of your site online if your origin web server goes offline.
Cloudflare’s Always Online feature ensures access to visitors for a portion of your Cloudflare-enabled website even if your origin web server is offline. Cloudflare does not cache every page of your website. Specifically, Always Online caches the first 10 links from your root HTML, then just the first links from each of those pages, and finally the first links from each of those subsequent pages.
A Cloudflare crawler identifies resources to place in the Always Online cache. For details, refer to our documentation about Cloudflare crawlers.
When always online is enabled, visitors see a green notification button at the top of their web page:
When Always Online displays content for an offline website, Cloudflare returns an HTTP status 503. Cloudflare continually checks for the site to come back online in order to display the full website to visitors. If the requested page is not in Cloudflare’s Always Online cache, the visitor sees the actual error page caused by the offline origin web server.
For domains proxied to Cloudflare, Cloudflare IPs connect to your origin web server. Security solutions can affect connections from Cloudflare unless you allow Cloudflare IPs. If you observe the Always Online banner while your origin web server is online, your origin web server or hosting provider are likely blocking or rate limiting Cloudflare requests.
Best practices using Always Online
Do not use Always Online with:
- Custom Hostnames (SSL for SaaS),
- API traffic,
- An IP Access Rule or Firewall Rule that blocks the United States, or
- A Cache Everything Page Rule that configures an Edge Cache TTL lower than the Always Online crawl frequency pertaining to your domain plan type.
There are limitations with the Always Online functionality:
1. Always Online is not immediately active for sites recently added to Cloudflare due to:
- DNS record propagation (can take 24-72 hours), or
- Always Online has not initially crawled the website.
2. Cloudflare cannot show private content behind logins or handle form submission (POSTs) if your origin web server is offline.
3. In order to trigger Always Online, your web server must return one of the following standard HTTP error codes:
- 502 or 504 timeout,
- Cloudflare errors (521 & 523),
- Timeouts (522 & 524),
- SSL errors (525 & 526), or
- Unknown errors (520), except for errors due to empty replies from your origin web server.
Toggle Always Online
Always online is enabled by default. To change the setting:
- Log in to your Cloudflare account.
- Choose the appropriate domain.
- Click the Caching app.
- Set Always Online to Off or On.
Alternatives to globally enabling Always Online include:
- Using Cloudflare Page Rules to enable Always Online, or
- Allowing your origin web server to determine which content to cache for display if your origin web server is offline:
- Disable Always Online,
- Set Origin Cache Control for your resources, and
- Enable stale-if-error at your origin.