Set up dynamic web content

You need to run the "Create or update a policy" operation via the ACE API, and set the type element value to dynamic-web-content in the content-characteristics behavior.

Create or update a policy

General instructions on this operation can be found in the Akamai Cloud Embed API v2 documentation. (See Create or update a policy.)

Define the appropriate match criteria in the delivery policy

Like all other rules in a delivery policy, you must set a match criteria (matches) that must be met to apply the associated behaviors. In the example presented here, the url-wildcard match is used. This match compares the incoming request path (excluding query string) to what is defined as the value for the match "/*" is set here, which indicates all incoming request paths.

Include the "content-characteristics" behavior and set required members

To set up this support, you need to include the content-characteristics behavior, and the following members must be included:

  • type: This must be set to dynamic-web-content.
  • value: This must be included and always set to a hyphen (-).

Optional parameters

You have access to additional parameters ("params") with the content-characteristics behavior, when configuring support for dynamic web content:

Note: To configure these parameters in a subcustomer's policy, that subcustomer must be registered with a base configuration that has had the parameters enabled. They are enabled via the Content Characteristics - Dynamic Web Content behavior. (This behavior must be added to the base configuration, and the parameters must be set to "On.") If the behavior is not added, or a parameter is set to "Off," they cannot be included.
Name Type Description
sureRouteTestObjectPath String (optional) Include this to enable AkamaiSureRoute for the policy. The associated value must be a valid URI path that points to an object on your origin that meets the standard criteria for a valid SureRoute Test Object. (It can't have auth, and it must be compressible—between 4KB –12KB in size after compression.)
prefetchEnabled Boolean Include this and set the value to "Yes" to enable the embedded object pre-fetching feature
mobileImageCompressionEnabled Boolean Include this and set the value to "Yes" to enable compression of JPEG images for requests over certain mobile network conditions.

What is SureRoute?

The Akamai SureRoute feature provides the optimal route between an Edge server and the origin server, at any given point in time. If the sureRouteTestObjectPath parameter is left out of a subcustomer policy, SureRoute is disabled.

What is Prefetching?

Prefetching positions objects at the Edge to ready them for requests, to reduce the overall time to deliver these objects. This behavior relies on the "origin-assisted" prefetch model—it expects your origin to send details on the objects that need to be prefetched, in its response. When prefetchEnabled is set to "true," Edge servers "prefetch" objects that have the following file extensions:

.aif .gcf .ppc
.aiff .gff .pws
.au .gif .swa
.avi .grv .swf
.bin .hdml .txt
.bmp .hqx .vbs
.cab .ico .w32
.carb .ini .wav
.cct .jpeg .wbmp
.cdf .jpg .wml
.class .js .wmlc
.css .mov .wmls
.doc .mp3 .wmlsc
.dcr .nc .xsd
.dtd .pct .zip
.exe .pdf
.flv .png

What is Mobile Image Compression?

When mobileImageCompressionEnabled is set to "true," Akamai Edge servers increase the compression of JPEG images (.jpg, .jpeg, .jpe, .jif, .jfif, and .jfi extensions), when slower network speeds are detected for a requesting mobile client. Serving compressed images reduces the amount of data required to load a page, which can compensate for suboptimal network performance. You don't need to change any your HTML content when using or configuring mobile image compression.

When this compression is triggered, the Akamai network does the following:

  1. The application segment metadata is stripped. This does not affect how the image is displayed or decoded.
  2. The JPEG Comment (COM) segment is preserved. This segment may contain copyright information (which may need to be preserved).

JSON Examples

  • Example 1: This example shows how an endpoint is optimized for dynamic web content.
    {
        "rules":[
            {  
                "matches": [
                    {
                        "name": "url-wildcard",
                        "value": "/*"
                    }
                ],
                "behaviors": [
                    {
                        "name": "origin",
                        "value": "-",
                        "params": {
                            "cacheKeyValue": "-",
                            "digitalProperty": "sitecustomer.partnerdomain.net",
                            "cacheKeyType": "origin",
                            "hostHeaderValue": "-",
                            "originDomain": "dynamicwebcustomer.origin.mediaservices.partnerdomain.net",
                            "hostHeaderType": "origin"
                        },
                    },
                    {
                        "name": "content-characteristics",
                        "type": "dynamic-web-content",
                        "value": "-",
                        "params": {
                            "sureRouteTestObjectPath": "/akamai/akamai-sureroute-test-object.htm",
                            "realUserMonitoring": true,
                            "prefetchEnabled": true,
                            "mobileImageCompressionEnabled": true
                        }
                    }
                ]
            }
        ]
    }
  • Example 2: In this example the endpoint is optimized for dynamic web content, but SureRoute is disabled. (The sureRouteTestObjectPath member is left out.)
    {
        "rules":[
            {  
                "matches": [
                    {
                        "name": "url-wildcard",
                        "value": "/*"
                    }
                ],
                "behaviors": [
                    {
                        "name": "origin",
                        "value": "-",
                        "params": {
                            "cacheKeyValue": "-",
                            "digitalProperty": "sitecustomer.partnerdomain.net",
                            "cacheKeyType": "origin",
                            "hostHeaderValue": "-",
                            "originDomain": "dynamicwebcustomer.origin.mediaservices.partnerdomain.net",
                            "hostHeaderType": "origin"
                        },
                    },
                    {
                      "name": "content-characteristics",
                        "type": "dynamic-web-content",
                        "value": "-",
                        "params": {
                            "realUserMonitoring": true,
                            "prefetchEnabled": true,
                            "mobileImageCompressionEnabled": true
                        }
                    }
                ]
            }
        ]
    }