setOriginTemplate
setOriginTemplateRequired. The origin server is where your API is served from, so this setting is obligatory: without it Akamai has nowhere to forward requests.
{
"name": "setOriginTemplate",
"options": {
"originName": "main"
}
}Origin configuration is a two-step model in this API, and it's the one piece of the template that isn't entirely inside defaultSettings:
origins[], at the top level of the environment version, defines each origin and its connection settings. The template provides one namedmainwith empty options.setOriginTemplate.originNameselects which of those origins the default settings use.
{
"origins": [
{
"originName": "main",
"options": {
"hostname": "api.example.com"
}
}
]
}originName is write-once and must match an entry in origins[].
Because almost nothing is cached on this product, the origin connection is on the critical path for every request. Two things follow:
- Keep-alive and connection reuse matter more here than on a cacheable workload. The forward path is exercised constantly, which is also why
sureRouteships enabled. - Origin failure is immediately visible to callers. There's no failover setting in the API Acceleration default settings, so add
failActionto a rule if you need something other than the error your origin returns.
To route some requests to a different origin — a versioned backend, a canary, a separate auth service — add an originServer behavior to a rule rather than editing this setting.
