failoverTemplate
failoverTemplateKeeps your site available when your origin is slow or unreachable.
{
"name": "failoverTemplate",
"options": {
"originRetryCount": 3,
"originRetryInterval": "10s",
"originMaximumReconnects": 2,
"simulateFailover": true,
"headerName": "breakconnection",
"headerValue": "Your-Secret-Here",
"isStagingOnly": true,
"failoverActionType": "SERVE_ERROR"
}
}Origin health detection
Recommended. Monitors the health of your origin's IP addresses so edge servers stop retrying an IP that's failing. Akamai preconfigures these values based on performance best practices:
| Option | Ships as | What it means |
|---|---|---|
originRetryCount | 3 | Consecutive failures before an IP is marked faulty. |
originRetryInterval | 10s | How long an edge server waits before testing a faulty IP again. |
originMaximumReconnects | 2 | Total attempts an edge server makes across all available origin IPs. |
These work with sureRoute.originIpSelection in Accelerate Delivery & Offload Origin: health detection takes bad IPs out of play, and BEST_PERFORMING_ORIGIN_IP picks among the ones that are left.
Simulate failover
Lets you test your failover configuration without taking your origin offline. It's preset to run on the staging network only, and never executes in production.
| Option | Ships as | Why |
|---|---|---|
simulateFailover | true | Ready to test from the start. The three options below are only available while this is true. |
isStagingOnly | true | Keep this. It's what guarantees the simulation can't fire against production traffic. |
headerName | "breakconnection" | The request header that triggers the simulation. |
headerValue | "Your-Secret-Here" | The value that header must carry. |
When a staging request carries that header and value, Akamai applies Break Forward Connection, dropping the forward connection to your origin and forcing your failover settings to trigger so you can confirm they work.
Your-Secret-Hereis a placeholderAnyone who knows the header name and value can force failover on your staging network. Replace it with a unique, private string in your own template before testing.
Failover action
failoverActionType ships as SERVE_ERROR: when failover triggers, the edge serves an error rather than redirecting traffic somewhere that may not be ready for it. It's a safe default that needs no further configuration, and it's an override — the behavior's own default is REDIRECT.
On a DSA configuration, SERVE_STALE is a weaker fallback than it sounds: the edge has little stored HTML to serve stale, because cachingTemplate ships HTML as NO_STORE. If you want something better than an error page during an origin outage, ALTERNATE_CONTENT_NETSTORAGE with a static maintenance page is usually the more honest choice.
The other actions each need their own options, and failoverResponseCodes becomes available for all of them (it's unavailable under SERVE_ERROR):
| Value | Serves | Needs |
|---|---|---|
SERVE_STALE | Stale cached content | — |
REDIRECT | A redirect | redirectHostnameType, redirectMethod, optionally redirectHostname, redirectCustomPath / redirectPath, modifyProtocol / protocol |
ALTERNATE_HOSTNAME | Content from a backup hostname | alternateHostname, optionally alternateHostnameCustomPath / alternateHostnamePath |
ALTERNATE_HOSTNAME_PROVIDER | Content from an alternate provider | alternateHostnameProvider, optionally its custom path options |
ALTERNATE_CONTENT_NETSTORAGE | A static file from NetStorage | netStorageHostname, netStoragePath, netStoragePathStatusCode, failoverCpCode |
