Does an Akamai outgoing response header modification change the cached object?

The Citead team, updated

In short. An Akamai outgoing response header change is applied at delivery time and does not alter the cached object.

Definition: No. Akamai documents the outgoing response header behavior as a delivery-time operation: the header is applied after the response has been processed and retrieved from the origin or cache, immediately before it is sent to the client. The cached object therefore remains separate from that outgoing header change.

Key facts

When is the outgoing header applied?

Akamai's outgoing behavior modifies the selected response header according to the rule settings. The documentation places an added header after the Akamai server has processed the response and retrieved it either from the customer origin or from cache. It is applied immediately before delivery to the requesting client.

That order allows a response header to vary by request while the page body remains the same cached page. Akamai gives a requester's IP address as its example:

Your-IP-Address: <IP address retrieved from the request>

The example says that many end-users can receive the same cached page while the Your-IP-Address value represents the IP address associated with each request.

How does incoming response processing differ?

The incoming behavior handles response headers coming downstream from the origin. Akamai says an added incoming header is placed before the object is processed by the Akamai server. If the response is cacheable, the header is stored with the cached object.

This stage is therefore the documented choice when the header is part of the object that Akamai caches. The incoming documentation names Cache-Control and Expires as examples of headers that can specify caching policy. It also gives Origin-Server-ID as a debugging example containing information about the origin server and the time the page was added to cache.

Which outgoing changes are available?

The outgoing behavior can add, remove, modify, or find and replace response headers. Akamai describes Modify as equivalent to an add and a remove. A standard header can be selected, or a custom header name can be entered with the Other option. Header values support Akamai variable expression syntax, and typing {{ opens variable autocomplete in the option field.

The Avoid Duplicate Headers option applies only to headers added by this behavior. It does not apply to headers added at the origin. For Find & Replace, the documentation says that regular expression special characters are treated as literals and that the Find What option does not support variables. The Occurrences setting chooses between replacing all matches and replacing the first occurrence only.

What does this change for a website?

Use the outgoing stage for a header whose delivered value depends on the request, such as the documented Your-IP-Address example. That value is added when Akamai is preparing the response for the client, so the cached page can be reused while the header varies at delivery time.

Use the incoming stage when the header needs to be stored with a cacheable object. Akamai's incoming documentation describes Cache-Control and Expires in that context, while its outgoing documentation describes the header as added after retrieval from the origin or cache.

FAQ

Will a cached page carry a per-user outgoing header?

Yes. Akamai's example says that each end-user can receive the same cached page while the Your-IP-Address header represents that requester's IP address.

Should Cache-Control be added with the outgoing behavior?

When the intended result is a header stored with a cacheable object, Akamai documents the incoming response header behavior for that stage and names Cache-Control as an example.

Does Avoid Duplicate Headers remove a header set by the origin?

No. Akamai limits this option to headers added using the behavior, and says it does not apply to headers added at the origin.

Sources

  1. Akamai TechDocs, "Modify Outgoing Response Header", undated
  2. Akamai TechDocs, "Modify Incoming Response Header", undated

Check how a page reads to answer engines. Open the GEO score analyzer

Test a page and see what to fix first

The analysis usually takes less than 10 seconds and needs no account.

400,000+ pages scored in the public benchmark