Edge Security Acceleration (ESA) supports image optimization rules, which apply to requests that match the specified filter conditions. You can convert image formats and quality, crop, resize, and cache images from the origin server. This accelerates image retrieval and reduces origin traffic.
If you want to configure website-level image optimization rules, see Image transformations.
Scenarios
ESA enables images to be transformed and cached on ESA POPs, without affecting the running of the origin server.
E-commerce platforms
Provides abundant image processing styles to meet different image display requirements on multiple devices, and enables efficient and simplified image editing.
Allows compression of product images and image comments to reduce image sizes, further lowering traffic costs.
Supports brands as watermarks to protect copyrights and promote products.
Social media
Easily and flexibly converts your images into standard formats that you can post on social media.
Supports watermarks to prevent image theft.
Online education
Edits images for online education based on user requirements.
Allows you to choose the type of compression that you want to enable based on business requirements. This helps you balance compression with image quality.
Design resource websites
Provides abundant image processing styles to meet different image display requirements on multiple devices, and enables efficient and simplified image editing.
Compresses images without compromising the image quality to accelerate image delivery. This allows websites to provide high-resolution images.
Before you begin
Before you use image transformations, take note of the following items:
Limitations on source images:
Supported image formats: JPEG, JPG, PNG, WebP, BMP, GIF, TIFF, and JPEG 2000.
The size of a source image cannot exceed 10 MB.
The total number of pixels of a source image cannot exceed 16,777,216.
NoteIf a source image is a GIF image, the total number of pixels is the sum of all frames. You can use tools such as ImageMagick to query the frame information of a GIF image.
Limitations on processed images:
The total number of pixels of a transformed image cannot exceed 16,777,216.
If you want to convert a transformed image to the WebP format, the total pixels of the image cannot exceed 16,777,216 pixels. The width or height cannot exceed 16,384 pixels. If a source image is a dynamic image, a static image is generated when you convert the source image to the WebP format.
Create an optimization rule
In the ESA console, choose Websites and click the website name you want to manage.
In the left-side navigation pane, choose .
On the Content Optimization page, click the Image Optimization tab. Click Create Rule, and fill in the Rule Name.
In the If Requests Match... area, specify the conditions for matching incoming requests. For more information about how to configure a rule, see Rules.
Turn on Image Transformations. For more information, see Match conditions.
Rule Name
Enter the name of the rule. It can be up to 64 characters in length, and can contain letters, digits, and underscores (
_).Match Condition
Specify the request characteristics for matching.
Click the logical operator to add conditions. You can add up to five conditions.
Each condition consists of a match field, logical operator, and match value.
Image editing methods
The following part describes the image editing parameters that are supported by ESA.
Parameter: format
Description: Converts images into specified formats.
Parameter: quality
Description: Adjusts the quality of images.
Parameter: crop
Description: Crops images.
Parameter: resize
Description: Resizes images. The feature only supports decreasing the size of images.
Parameter:
auto-orient: automatically rotates images.
rotate: rotates images to specific orientations.
Description: Rotates images based on the orientation parameter, or rotates images clockwise based on the angle that you specify.
Parameter:
bright: the brightness of images.
contrast: the contrast of images.
sharpen: the sharpness of images.
Description: Adjusts the brightness, contrast, and sharpness of images.
Parameter: watermark
Description: Adds picture or text watermarks to images.
Parameter: info
Description: Queries image information, including the width, height, format, and quality.