Construct Response

Construct a HTTP response, including a standard HTTP status code and a message you create, to be served from the ​Akamai​ edge server without retrieving the requested object from cache or requesting it from your origin.

For example, you can return an error response for a request that doesn't contain required cookies. You can also use this behavior to respond to requests for invalid paths or for content which doesn't exist.

How it works

This behavior constructs an HTTP response, complete with HTTP status code and body, to serve from the edge independently of your origin. It supports all request methods except for POST.

You can create a message of up to 2000 characters for the body of the response. If you exceed that limit, the response you constructed isn't sent and the client receives a 500 response code.

By default, edge servers evict any currently cached version of the object from cache, since it isn't being served. You can disable this functionality if the constructed response is temporary or only applies to certain requests and you want to serve cached content for some requests.

By default, edge servers ignore the Construct Response behavior when a purge request is made, in order to correctly purge the underlying object.

🚧

Don't use the Construct Response behavior with Bot Manager when you set up an alternate hostname to send bot traffic to an alternate page or site. Make sure the behavior is disabled in that case.

Features and options

FieldWhat it doesSub-options
StatusEnables or disables this behavior.
Response BodyThe HTML response you want the user to receive.

Variable Support: This option supports variable expression syntax. Typing {{ in the option field triggers variable auto complete. Learn more about variable support.
Response CodeThe response code you want the user to receive.
  • 200 OK
  • 404 Not Found
  • 401 Unauthorized
  • 403 Forbidden
  • 405 Method Not Allowed
  • 417 Expectation Failed
  • 500 Internal Server Error
  • 501 Not Implemented
  • 502 Bad Gateway
  • 503 Service Unavailable
  • 504 Gateway Timeout
Force Cache evictionEvict the underlying object from cache.
Ignore for Purge requestsIgnore this construct response for purge requests.