Image Stack is a paid option for optimizing images in JPG and PNG formats (mime-type: image/jpeg, image/png) on the fly. The original images remain unchanged but their versions in the CDN cache change according to your requirements.
The Image Stack option includes the following features:
How Image Stack can change your image:
Size: 3.55 MB
W×H: 553×743 px
Size: 476 KB
Size: 8 KB
|W×H: 333×500 px
|W×H: 400×500 px
Segment from the center
If you use Image Stack requests for images that will be proxied through our Processing Server, it takes an original image from your Origin Server and converts the image to WebP or applies others features. After that, a new version of the image will be saved in the Caching Server and sent to end users.
After converting, an image does not change its URL or extension. Only the following processing details will be added to image HTTP headers:
The image transformation operations are performed in this order:
Note: The quality feature cannot be performed separately from the others. If you want to change the image quality, activate one more feature.
If an image cannot be processed, an end user will receive the original image downloaded into the CDN cache from the Origin Server. We will serve original images in the following cases:
Use the "Img-Skip-Reason" HTTP header to find out why the image was not converted:
Some browsers (e.g., Google Chrome) add the Accept header with the value image/webp or image/avif not only to images, but also to static content like PHP and JS scripts.
All requests with the Accept header are redirected to the Image Processing Server. Usually, when the server cannot convert the file (e.g., when it’s a PHP file), it returns the content from the origin.
Difficulties appear if the Rewrite option is enabled for your resource. It redirects the requests to the origin. The origin responds with the 3xx code, but the Image Processing Server cannot return the 3xx response code.
If the PHP or JS files are requested, the Image Processing Server will turn to the origin. But it responds only with the 3xx code. The Processing Server will try to follow the redirect until it receives a different response code. This will cause the file to be inaccessible.
To avoid this issue, we recommend enabling the Image Stack option in the Rules section by following the steps in our "Enable Image stack" guide. This way, you clearly indicate that the option will only work for files with mime type image/jpeg or image/png.
You can enable Image Stack for the entire resource in the resource settings only if the origin consists of static image assets.
Was this article helpful?
Learn more about our next-gen CDN