image_​manager

Version: v2025-01-13Includes use: Yes

Behavior name: Image and Video Manager (Images)

Optimizes images' size or file type for the requesting device. You can also use this behavior to generate API tokens to apply your own policies to matching images using the Image and Video Manager API. To apply this behavior, you need to match on a file_extension. Once you apply Image and Video Manager to traffic, you can add the advanced_im_match to ensure the behavior applies to the requests from the Image and Video Manager backend.

Default behavior

These samples reflect the behavior's default settings. You can use these as is in your configurations or make adjustments based on the behavior's available options.

data "akamai_property_rules_builder" "image_manager" {
  rules_v2025_02_18 {
    name     = "Image and Video Manager (Images)"
    comments = "Optimizes images' size or file type for the requesting device."
    behavior {
      image_manager {
        enabled                 = true
        resize                  = false
        apply_best_file_type    = true
        super_cache_region      = "US"
        cp_code_original        = ""
        cp_code_transformed     = ""
        use_existing_policy_set = false
        advanced                = false
        policy_token_default    = "default"
      }
    }
  }
}
"behaviors": [
  {
  "name": "imageManager",
  "options": {
    "enabled": true,
    "resize": false,
    "applyBestFileType": true,
    "superCacheRegion": "US",
    "cpCodeOriginal": "",
    "cpCodeTransformed": "",
    "useExistingPolicySet": false,
    "advanced": false,
    "policyTokenDefault": "default"
    }
  }
]

Options

Option Description
enabled
Enable image management capabilities and generate a corresponding API token.
resize
Specify whether to scale down images to the maximum screen resolution, as determined by the rendering device's user agent. Note that enabling this may affect screen layout in unexpected ways.
apply_best_file_type
Specify whether to convert images to the best file type for the requesting device, based on its user agent and the initial image file. This produces the smallest file size possible that retains image quality.
super_cache_region
Specifies a location for your site's heaviest traffic, for use in caching derivatives on edge servers. Value is one of:
  • US
  • ASIA
  • AUSTRALIA
  • EMEA
  • JAPAN
  • CHINA
cp_code_original
Specifies the CP code for which to track Image and Video Manager video traffic. Use this along with cp_code_transformed to track traffic to derivative video content. You only need to provide the initial id, stripping any cpc_ prefix to pass the integer to the rule tree. Additional CP code details may reflect back in subsequent read-only data. Contains:
  • limits. Describes the current usage limit for the CP code.
  • date. UNIX epoch timestamp reflecting when the CP code was originally created.
  • description. Additional information about the CP code.
  • id. Unique identifier for each CP code. Initially, you get this value when creating a new CP code in PAPI. You can also assign a cpcodeId value from the List CP codes operation.
  • name. The name of the CP code you specify as the cpcodeName when creating a new CP code in PAPI. You can modify this value with the PUT operation in the CP codes and Reporting Groups API.
  • products. The set of products the CP code is assigned to. This reflects productId values you specify when creating a new CP code in PAPI.
cp_code_transformed
Specifies the CP code to identify derivative transformed video content. You only need to provide the initial id, stripping any cpc_ prefix to pass the integer to the rule tree. Additional CP code details may reflect back in subsequent read-only data. Contains:
  • cp_code_limits. Describes the current usage limit for the CP code.
  • created_date. UNIX epoch timestamp reflecting when the CP code was originally created.
  • description. Additional information about the CP code.
  • id. Unique identifier for each CP code. Initially, you get this value when creating a new CP code in PAPI. You can also assign a cp_code_id value from the List CP codes operation.
  • name. The name of the CP code you specify as the cp_code_name when creating a new CP code in PAPI. You can modify this value with the PUT operation in the CP codes and Reporting Groups API.
  • products. The set of products the CP code is assigned to. This reflects product_iId values you specify when creating a new CP code in PAPI.
use_existing_policy_set
Whether to use a previously created policy set that may be referenced in other properties, or create a new policy set to use with this property. A policy set can be shared across multiple properties belonging to the same contract. The behavior populates any changes to the policy set across all properties that reference that set.
policy_set
Identifies the existing policy set configured with Image and Video Manager API.
advanced
Generates a custom Image and Video Manager API token to apply a corresponding policy to this set of images. The token consists of a descriptive label the policy_token_concatenated with a property-specific identifier that's generated when you save the property. The API registers the token when you activate the property.
policy_token
Assign a prefix label to help match the policy token to this set of images, limited to 32 alphanumeric or underscore characters. If you don't specify a label, default becomes the prefix.
policy_tokenDefault
Specify the default policy identifier, which is registered with the Image and Video Manager API once you activate this property. The advanced option needs to be inactive.