Akamai (BYOCDN)

This configuration routes agentic traffic (requests from AI bots and LLM user agents) to the Edge Optimize backend service (live.edgeoptimize.net). Human visitors and SEO bots continue to be served from your origin as usual. To test the configuration, after the setup is complete, look for the header x-edgeoptimize-request-id in the response.

Prerequisites

Before setting up the Akamai Property Manager rules, ensure you have:

  • Access to Akamai Property Manager for your domain.
  • Completed the LLM Optimizer onboarding process.
  • Completed CDN log forwarding to LLM Optimizer.
  • An Edge Optimize API key retrieved from the LLM Optimizer UI.
  • (Optional) A staging Edge Optimize API key if you test routing on a staging hostname first.

Steps to retrieve your production Edge Optimize API key:

  1. In LLM Optimizer, open Customer configuration and select the CDN configuration tab.

    Navigate to Customer Configuration

  2. Locate the Deploy optimizations to AI agents section. Tick the Enable optimization engine checkbox.

    Deploy optimizations to AI agents — pending

  3. In the confirmation dialog, select Enable.

    Enable optimization engine confirmation dialog

  4. Select View details. In the Deploy optimizations details dialog, copy the Production API key (use Copy next to the field).

    Production API key in Deploy optimizations details

    note
    NOTE
    The dialog may show that setup is not complete. This is expected until routing is verified — you can still copy the API key so your IT or CDN team can finish the configuration.

Additionally, if you require any help with the above steps, reach out to your Adobe account team or llmo-at-edge@adobe.com.

Use a staging hostname when you want to test Optimize at Edge in a lower environment before production traffic uses the routing rules.

Prerequisites

  • The staging hostname must belong to the same registrable domain as your production site (for example, https://staging.example.com when production is https://www.example.com).
  • Only one staging domain can be configured for the site. After it is saved, it cannot be changed without assistance.

Steps

  1. In LLM Optimizer, open Customer configuration and select the CDN configuration tab.

  2. In the Deploy optimizations to AI agents section, select Add stage domain (or Stage domain if a staging domain is already configured).

  3. In the Stage Domain dialog, enter the full staging URL including https:// and select Set Domain.

    Stage Domain input dialog

  4. Confirm the domain in the next prompt. When the workflow completes, the Stage Domains dialog shows the configured domain and its API key. Select Copy to copy the staging API key.

    Staging domain API key

If you need help, contact llmo-at-edge@adobe.com.

Configuration

The following Akamai Property Manager rule routes agentic HTML page traffic to Edge Optimize. The configuration includes the following steps:

1. Set routing criteria (User-Agent and HTML traffic matching)

Set routing for the following user agents:

 *AdobeEdgeOptimize-AI*
 *ChatGPT-User*
 *GPTBot*
 *OAI-SearchBot*
 *PerplexityBot*
 *Perplexity-User*
NOTE
Apply the Optimize at Edge routing rule only to agentic HTML page traffic. A common setup is to use request-side criteria such as File Extension to match html and EMPTY_STRING for extensionless page URLs. If your site serves HTML from other URL patterns, or includes extensionless non-page routes such as API endpoints, refine the rule with additional path-based criteria.

Set routing criteria

2. Set Origin and SSL behavior

Set origin as live.edgeoptimize.net and Match SAN to *.edgeoptimize.net

NOTE
If property activation fails after you add the Optimize at Edge rule, check whether the rule uses a different Origin Server SSL verification mode than the default rule. If it does, update the Optimize at Edge rule to match the default rule. For example, if the default rule uses Platform Settings, use Platform Settings here as well. If you cannot use the required setting, contact Akamai support.

Set Origin and SSL behavior

3. Set Cache Key Variable

Set the cache key variable PMUSER_EDGE_OPTIMIZE_CACHE_KEY to LLMCLIENT=TRUE;X_FORWARDED_HOST={{builtin.AK_HOST}}

Set Cache Key Variable

4. Caching Rules

Caching Rules

5. Modify Incoming Request Headers

Set the following incoming request headers:
x-edgeoptimize-api-key to the API Key retrieved from LLMO
x-edgeoptimize-config to LLMCLIENT=TRUE;
x-edgeoptimize-url to {{builtin.AK_URL}}

Modify Incoming Request Headers

6. Modify Incoming Response Headers

Modify Incoming Response Headers

7. Cache ID Modification

Cache ID Modification

8. Modify Outgoing Request Headers

Set x-forwarded-host header to {{builtin.AK_HOST}}

Modify Outgoing Request Headers

9. Site Failover

The Site Failover configuration has two parts: the failover behavior (configured inside the main optimize-at-edge routing rule) and a separate failover test header rule.

9a. Site Failover Behavior (inside the main optimize-at-edge routing rule)

Inside the main routing rule, configure the Site Failover behavior and the Advanced XML snippet as follows:

IMPORTANT
The XML snippet in this step requires the Advanced behavior. In some Akamai environments, this behavior is not available for self-service editing. If you do not see the Advanced option, contact your Akamai account team or Akamai support to enable the required configuration.

Site Failover

Add the request header x-edgeoptimize-request with value fo through Advanced XML:

<forward:availability.fail-action2>
<add-header>
<status>on</status>
<name>x-edgeoptimize-request</name>
<value>fo</value>
</add-header>
</forward:availability.fail-action2>

Failover Behaviors

9b. Failover Test Header rule (sibling rule)

IMPORTANT
Create the EdgeOptimize Failover - Test Header rule as a sibling (at the same level) of the routing rules — not nested inside them. In the Akamai Property Manager rule tree, the hierarchy should look like:
code language-none
▼ Parent Rule
     ▶ Optimize at Edge Routing     ← routing rule
       EdgeOptimize Failover - Test Header       ← sibling, same level
This ensures the failover test header rule evaluates for all routing rules, not just one.
Also ensure the Optimize at Edge Routing rule is not overridden by any later matching rule that changes the origin, caching behavior, or cache ID for the same requests. If another matching rule resets these behaviors, Optimize at Edge routing or caching may not work as expected.

If the request header x-edgeoptimize-request value is fo, then set the outgoing response header x-edgeoptimize-fo to true.

Failover Rules

Site Failover ensures that if Edge Optimize returns a 4XX or 5XX error, the request is automatically routed back to your default origin so the end-user still receives a response.

Scenario
Behavior
Edge Optimize returns 2XX
Optimized response is served to the client.
Edge Optimize returns 4XX or 5XX
Request is routed back to the default origin.

Verify the setup

After completing the setup, verify that bot traffic is being routed to Edge Optimize and that human traffic remains unaffected.

1. Test bot traffic (should be optimized)

Simulate an AI bot request using an agentic user-agent:

curl -svo /dev/null https://www.example.com/page.html \
  --header "user-agent: chatgpt-user"

A successful response includes the x-edgeoptimize-request-id header, confirming that the request was routed through Edge Optimize:

< HTTP/2 200
< x-edgeoptimize-request-id: 50fce12d-0519-4fc6-af78-d928785c1b85

2. Test human traffic (should NOT be affected)

Simulate a regular human browser request:

curl -svo /dev/null https://www.example.com/page.html \
  --header "user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36"

The response should not contain the x-edgeoptimize-request-id header. The page content and response time should remain identical to before enabling Optimize at Edge.

3. How to differentiate between the two scenarios

Header
Bot traffic (optimized)
Human traffic (unaffected)
x-edgeoptimize-request-id
Present — contains a unique request ID
Absent
x-edgeoptimize-fo
Present only if failover occurred (value: 1)
Absent

4. Staging domain (optional)

If you use a staging hostname and staging API key from LLM Optimizer, deploy the same routing pattern on your staging Akamai property using the staging key in your rules. Then verify bot traffic on the staging host:

curl -svo /dev/null https://staging.example.com/page.html \
  --header "user-agent: chatgpt-user"

Replace https://staging.example.com/page.html with your real staging URL and path. A successful response includes the x-edgeoptimize-request-id header.

The status of the traffic routing can also be checked in the LLM Optimizer UI. Navigate to Customer configuration and select the CDN configuration tab.

Deploy optimizations to AI agents — completed

To learn more about Optimize at Edge, including available opportunities, auto-optimization workflows, and FAQs, return to the Optimize at Edge overview.

recommendation-more-help
llm-optimizer-help-main-toc