Apply your policies

There are three ways to apply an Image and Video Manager policy to the images or videos in your website or application:

Let the default policy be applied

If you used distinct policy set names in separate Image and Video Manager rules to distinguish treatment of your images and videos, then your web performance configuration is already set up to apply the default policy for each policy set.

Use the Set Parameter behavior

Add the Image and Video Manager Set Parameter behavior to the Image and Video Manager rule that applies to the request.

You can use this option if:

  • You used Image and Video Manager rules to select requests based on strings in the URLs, or
  • You followed the instructions in Add the Set Parameter behavior to assign the appropriate policy name to each request.

Add query string parameters to URLs

Add query string parameters to the image or video URLs on your website. You will need to modify your website's HTML to include parameters in the image or video URLs. The parameters are in the request before it reaches the CDN.

To use query string parameters to apply a policy to an image or video, append the following after the file name in the URL:

  • A question mark
  • The query string key, for example: impolicy
  • An equal sign
  • The value of the query string key

Example:

http://www.example.com/images/products/item12345.jpg?impolicy=mypolicy

To chain multiple parameters together, use the ampersand (&) character.

Example:

http://www.example.com/images/products/item12345.jpg?impolicy=mypolicy&imwidth=320&imformat=chrome&?imdensity=2.4

Each parameter type—policy name, image width, image format, and pixel density—can only be applied once to a given request. If a URL contains multiple instances of the same parameter, Image and Video Manager only uses the last one.

📘

You can apply only one image or video policy to a URL. Many content management systems (CMS) include tools to manage query string parameters in URLs. It's common to insert query string parameters via a website's CMS.


Did this page help you?