AVIF vs WebP, measured
Which format is smaller on photos, screenshots and icons, with the bytes.
Read the guideCDN.com.tr Help
Switch on image optimization for the account or for one delivery rule and choose WebP or WebP + AVIF: the edge converts JPEG and PNG images and sends each browser a format it accepts, while your pages keep the same image URLs.
Cache, security, WAF, and purge
Switch on image optimization for the account or for one delivery rule and choose WebP or WebP + AVIF: the edge converts JPEG and PNG images and sends each browser a format it accepts, while your pages keep the same image URLs.
The account switch covers JPEG and PNG files on every rule. A rule switch covers only that rule's paths, a good way to try it on one folder or one domain first.
The format is set once for the account and applies wherever image optimization is on.
The account switch is the quickest start; a rule switch limits it to that rule's paths.
Expected result: JPEG and PNG requests on those paths are converted at the edge.
curl -s -X POST -H "Authorization: Bearer $CDN_TOKEN" -H 'Content-Type: application/json' -d '{"type":1}' https://cdn.com.tr/api/accounts/$ACCOUNT_UUID/image_optimization
# one rule instead: set "image_optimization":"on" in the rule JSON
cdnctl cdn advanced-rules create --account "$ACCOUNT_UUID" --file rule-images.json
The format applies wherever image optimization is on, account-wide or in a rule.
Expected result: With WebP + AVIF, browsers that accept AVIF receive AVIF from the same URLs; the others receive WebP or the image in its original format.
curl -s -X POST -H "Authorization: Bearer $CDN_TOKEN" -H 'Content-Type: application/json' -d '{"enabled":true}' https://cdn.com.tr/api/accounts/$ACCOUNT_UUID/image_avif
Images cached before you switched optimization on keep their old format until they expire, so purge the image paths after switching on. A format change needs no purge.
Expected result: The check lists each image with the format and size a modern browser receives; when the optimizer kept the original because the conversion was not smaller, the row says so.
cdnctl purge --account "$ACCOUNT_UUID" --path /wp-content/uploads/ --type prefix
curl -s -H "Authorization: Bearer $CDN_TOKEN" "https://cdn.com.tr/api/accounts/$ACCOUNT_UUID/image_check?host=www.example.com"
A store wants lighter product photos without re-exporting its media library, installing a plugin or changing a single image URL.
Accept header, sends AVIF, WebP or the image in its original format, and answers with Vary: Accept. With WebP alone, browsers that accept WebP are redirected (302) to a WebP copy at the same name plus .webp (photo.jpg.webp), and the others get the image in its original format. Your HTML keeps the same image URLs either way.?w= or ?h= are not compared.Most often the copy was cached before you switched optimization on: purge those paths and request them again. Other reasons: at full size the conversion was not smaller than the original, the browser accepts neither WebP nor AVIF, or the request asked for no image format in particular (a plain curl sends Accept: */*). The image format check on the Delivery Rules page lists, image by image, what a modern browser and a plain client receive.
Yes. Add ?w= (width), ?h= (height) or both to an image URL. One value keeps the aspect ratio, both fit the image inside that box, and an image is never enlarged beyond its original size. Keep w and h in that rule's cache key (the default, the full query string, does): a rule that ignores every query parameter caches one size for all of them. Resized images are converted too, but they are not compared with the original.
There is no separate package. Processing counts toward the account's monthly quota, like traffic: each conversion counts the original it reads plus the image it returns, and AVIF counts at a higher rate than WebP because encoding it takes more processing. The panel shows the current rate under the switch, and Data Consumption shows image optimization as its own line.
It is a choice, not a requirement. WebP alone reaches almost every browser in use. WebP + AVIF adds AVIF for the browsers that accept it, usually the smallest format for photographs: in our measurement a 262,025-byte JPEG photo went out as 86,936 bytes of AVIF. Run the image format checker on your own pages to see the difference.