Accelerate Delivery & Offload Origin

Eleven of the eighteen settings are here. They split into two groups that pull in opposite directions: transport and routing settings that make the trip to your origin as fast as possible, and caching settings that are deliberately turned off because an API response usually can't be reused.

dnsAsyncRefresh

{
  "name": "dnsAsyncRefresh",
  "options": {
    "enabled": true,
    "timeout": "2h"
  }
}

Defines how edge servers behave when your origin's DNS A record expires. Enabled, the edge forwards the current request using the expired record while refreshing the record in the background. Disabled, the edge has to resolve DNS before forwarding, and a slow or failed resolution turns into user-perceived latency or a denial of service.

timeout is how long an expired record stays usable while the refresh happens. 2 hours is the shipped value, which is the behavior's own default — unlike Ion and DSA, which override it to 5 hours. The shorter window suits an API backend that may be re-pointed during a deploy: a stale record is tolerated for less time.

📘

timeout is only available while enabled is true. If you set enabled to false and later back to true without restating timeout, you get the behavior default of 2 hours — which here is the same value the template ships.

For finer control over origin timeouts, add the optional readTimeout and connectTimeout behaviors to a rule.

http3

{
  "name": "http3",
  "options": {
    "enable": true
  }
}

HTTP/3 replaces TCP with the IETF QUIC protocol, which means faster connection setup and more efficient stream handling. For small API responses, connection setup is a large share of total time, so this is one of the higher-leverage settings in the template. Note the option is enable, not enabled.

Requires TLS 1.3 for client-to-edge requests.

http2Template

{
  "name": "http2Template",
  "options": {
    "enabled": true
  }
}

HTTP/2 gives you concurrent requests over one TCP connection and header compression. Header compression matters disproportionately on API traffic, where an authorization header can be larger than the response body.

Note the shape: this is the composite http2Template behavior carrying a boolean enabled, not the individual http2 behavior. Leave the object as the template delivers it.

allowTransferEncoding

{
  "name": "allowTransferEncoding",
  "options": {
    "enabled": true
  }
}

Allows chunked transfer encoding. It matters here for streamed and long-polling responses, where your origin starts sending before it knows the total length.

  • Chunked transfer encoding has to be enabled on your origin too.
  • Don't set this to false if you use HTTP/2 or HTTP/3. Denying chunked encoding there results in a denial of service for clients requesting chunked content — and both are on by default in this same template.

sureRoute

{
  "name": "sureRoute",
  "options": {
    "enabled": true,
    "type": "PERFORMANCE",
    "testObjectUrl": "/akamai/sureroute-test-object.html",
    "toHostStatus": "INCOMING_HH",
    "originIpSelection": "BEST_PERFORMING_ORIGIN_IP",
    "raceStatTtl": "30m",
    "forceSslForward": false,
    "enableCustomKey": false,
    "srDownloadLinkTitle": ""
  }
}

SureRoute finds the fastest path between edge servers and your origin by racing candidate routes, and keeps failover paths available. It's aimed at non-cacheable content — which, on this product, is nearly everything. With caching shipping as NO_STORE, the route to your origin is the delivery path, and this is the setting that optimizes it.

OptionShips asWhy
typePERFORMANCERaces three simultaneous paths, triggered by real end-user requests for non-cacheable content, and promotes the fastest. Adapts as internet conditions change. The alternative is CUSTOM_MAP, which needs a map from Akamai.
testObjectUrl/akamai/sureroute-test-object.htmlThe object the races request. The path is seeded for you, but you must put the object on your origin — including on an origin that otherwise serves only JSON.
toHostStatusINCOMING_HHRaces use the forward host header you already set for your origin, so they test the same request path real traffic takes. Use OTHER with toHost to race a different hostname.
originIpSelectionBEST_PERFORMING_ORIGIN_IPWhen your origin hostname resolves to more than one IP address, forward requests go to the best-performing one rather than being spread across them. The alternative is ROUND_ROBIN.
raceStatTtl30mHow long a race result is reused before the next race.
forceSslForwardfalseRaces follow the request's protocol. Set true if your origin only accepts HTTPS.
enableCustomKeyfalseRace results are stored per origin hostname. With true, customStatKey sets the grouping explicitly.

Every option above except enabled is only available while enabled is true.

earlyData

{
  "name": "earlyData",
  "options": {
    "enabled": false
  }
}

Early Data (0-RTT) is a TLS 1.3 feature that lets a client resuming a session send data during the handshake, removing a round trip and reducing time to first byte.

It ships present but off. Turning it on is a one-field edit rather than adding a behavior, but it stays an opt-in — and the reason bites harder here than elsewhere. 0-RTT data can be replayed by an attacker who captures it, and a replayed API request is a request your origin may process twice. Akamai limits Early Data to GET requests without query parameters, which contains the risk, but your origin still has to treat those as safely repeatable.

Before you turn it on, confirm:

  • Secure connection. Your certificate's deployment settings must have TLS 1.3 enabled.
  • Compatibility. Early Data is incompatible with the enforceMtlsSettings behavior. You can't use both — and mTLS is common on API configurations.
  • Origin support. Your origin must recognize the Early-Data: 1 header and should return HTTP 425 (Too Early) for requests it can't safely process over 0-RTT.

To extend 0-RTT beyond GET requests, add the earlyDataAdvanced behavior to a rule. Think carefully before you do that on an API that accepts writes.

caching

{
  "name": "caching",
  "options": {
    "behavior": "NO_STORE"
  }
}

The defining setting of this template. Edge servers don't store responses at all.

That's the correct default for an API: responses are typically per-caller, often authorized, and frequently changing, and serving one caller's response to another is a data-leak bug rather than a performance win. It also satisfies the product's validation requirement that caching be configured somewhere in the tree — the requirement is that you've decided, not that you cache.

ValueEffect
NO_STOREShips as this. Nothing is cached at the edge.
MAX_AGECache for a fixed TTL. Makes mustRevalidate and ttl available.
BYPASS_CACHEDon't serve from cache, but don't send cache-busting instructions either.
CACHE_CONTROLHonor the origin's Cache-Control.
EXPIRESHonor the origin's Expires.
CACHE_CONTROL_AND_EXPIRESHonor both.

Rather than changing this value, add caching back for the endpoints that deserve it — reference data, catalogs, feature flags — with a caching behavior in a rule. Because the default setting uses the individual behavior rather than a composite template, the object you put in the rule has exactly the same shape.

❗️

If you switch to a cacheable policy, revisit three things

cacheError and removeVary below only do anything when caching is on, SureRoute disables itself for cacheable content, and the cache key includes the full query string unless you add a cacheKeyQueryParams behavior. An API that caches needs a cache-key decision; the template doesn't make one for you because it doesn't cache.

cacheError

{
  "name": "cacheError",
  "options": {
    "enabled": false
  }
}

Caches origin error responses — 204, 305, 404, 405, 414, and 501–505 — for 10 seconds by default, so a burst of requests for something broken doesn't all reach your origin.

It ships off, which is an override of the behavior's own true default, and it follows from caching: NO_STORE: cacheError only works with caching enabled, so an enabled value here would be inert. It's also the more conservative choice for an API, where a 404 can be a legitimate per-caller answer rather than a missing file.

Turn it on with enabled: true — and optionally ttl and preserveStale — if you switch to a cacheable policy and want error absorption.

removeVary

{
  "name": "removeVary",
  "options": {
    "enabled": true
  }
}

Akamai doesn't cache a response that carries a Vary header for anything other than Accept-Encoding. This behavior strips the header so those responses become cacheable.

It ships on, which is the behavior's own default — and it's the one caching-related setting in this template that's enabled rather than disabled. With caching: NO_STORE nothing is being cached for it to affect, so its practical value is that the moment you add a caching behavior to a rule, Vary-carrying responses are already eligible.

❗️

Removing Vary discards your origin's statement that the response differs by request header. If any endpoint varies by Accept-Language, Accept, or an API-version header and you later enable caching, you'll serve the wrong representation. Set enabled: false here, or override it in the rule that turns caching on.

validateEntityTag

{
  "name": "validateEntityTag",
  "options": {
    "enabled": true,
    "nonStrictEnabled": true,
    "weakEnabled": true
  }
}

Lets edge servers answer a conditional request with 304 Not Modified when the client's If-None-Match matches the cached object's ETag, so a revalidation costs headers instead of a body. This is in addition to Last-Modified / If-Modified-Since validation.

OptionShips asWhy
enabledtrueETag revalidation is on. The two options below are only available while this is true.
nonStrictEnabledtrueAccepts strong ETags that aren't enclosed in double quotes. Technically malformed, but common in real origin responses — and especially common from hand-rolled API frameworks.
weakEnabledtrueAccepts weak ETags prefixed with W/, which assert semantic equivalence rather than byte-for-byte identity. With this off, a weak ETag always gets a full 200 OK.

Both permissive options ship on so that revalidation works with whatever your origin actually emits, rather than only with spec-perfect ETags.

downstreamCacheTemplate

Where caching governs the edge, this governs caching downstream of the edge: client libraries, mobile apps, and corporate proxies.

{
  "name": "downstreamCacheTemplate",
  "options": {
    "cacheOption": "ALLOW",
    "cacheLifetime": "LESSER",
    "sendHeaders": "CACHE_CONTROL_AND_EXPIRES",
    "sendPrivate": false,
    "bustUncacheable": true,
    "applyHtmlCaching": false
  }
}
OptionShips asWhy
cacheOptionALLOWDownstream storage is permitted in principle. In practice bustUncacheable below governs most responses, because the edge isn't caching them. Alternatives: MUST_REVALIDATE, BUST, TUNNEL_ORIGIN, NONE.
cacheLifetimeLESSERClients are told to cache for whichever is shorter: the time left in the edge cache or the value from your origin headers.
sendHeadersCACHE_CONTROL_AND_EXPIRESBoth headers go downstream. This is an override of what Ion and DSA ship (CACHE_CONTROL alone), and it's a hedge for non-browser clients: API consumers include old HTTP libraries that read Expires and ignore Cache-Control. Other values: EXPIRES, PASS_ORIGIN.
sendPrivatefalseNo private directive. Turn it on if responses are per-caller and might otherwise be held by a shared corporate proxy.
bustUncacheabletrueFor content the edge won't cache — on this product, nearly everything — actively prevent downstream caching by sending Expires: [current time], Cache-Control: max-age=0, Cache-Control: no-store, Cache-Control: no-cache, and Pragma: no-cache.
applyHtmlCachingfalseNo separate downstream policy for HTML. An API serves little or no HTML, so there's nothing to treat differently — the opposite of the DSA template, which splits HTML out.

cacheLifetime and sendHeaders are only available with cacheOption: ALLOW, and ttl only with cacheLifetime: FROM_VALUE. Setting ttl to 0 forces revalidation and sends all cache-busting headers downstream, whatever sendHeaders says. sendPrivate needs cacheOption to be ALLOW or MUST_REVALIDATE, and sendHeaders not to be EXPIRES.

📘

NO_STORE at the edge plus bustUncacheable downstream

Together these mean an API response is stored nowhere by default: not at the edge, not in the caller's HTTP client, not in a proxy between them. That's the baseline. Every bit of caching you want back is something you add deliberately, in a rule, for a named set of endpoints.