About the resize feature

What is it? Resize is a feature that reduces the height and width of an original JPG or PNG before it is delivered over the CDN. You set the height, width, and reduction method (compression or cropping) for each image.

Example. An origin server hosts an 1100×1500 px image, but you set the following Resize parameters: height=200, width=150. As soon as the image gets to the CDN cache, it is automatically reduced in size. As a result, the origin still has the 1100×1500 image, but end users receive the 200×150 reduced version:

How it works. To set a new height and width for an image, you add the necessary query string to the image URL on your website source. These query strings are described in the Use Resize section. When a user requests a website page, the CDN will deliver it with reduced images.

Enable resize

Resize is included in the paid Image Stack option. This option helps optimize images, such as by converting them to WebP or AVIF format, cropping them, or changing their quality and size. To use Resize, you need to activate Image Stack according to the “Enable Image Stack” guide.

Use resize

1. Open the website source code.

2. Find the strings with the URLs of the images that you want to reduce using Resize.

3. Add the query strings to the URLs of the images.

A query parameter should be set as follows:

image.jpg?parameter=value

Two or more parameters should be set as follows:

image.jpg?parameter#1=value¶meter#2=value&… 

where image.jpg is the URL of an image on the website.

Query parameter, how it works:

4. Save the changes in the website source code.

Images on the website will now be shown to the end-user with the dimensions that you set.

Check HTTP headers

You can use the HTTP header value of the image to check if the changes have been applied. The X-Img-Operations header reflects all the conversions performed. If the value includes “resize”, the image size has changed.

If the HTTP header contains no resize value and CDN returns origin image, check the Img-skip-reason HTTP header. This will explain the reason why the operation could not be done.