Why my CDN Traffic usage is not equal to the Image Cache?

The CDN Traffic is the amount of cached data requested by end users and delivered by the CDN servers.

For example, if you have 1 image with size 2MB that is stored in a CDN server and 10 users request it, then the result would be 2 x 10 = 20MBs total CDN traffic.

The Image Cache is the total amount of cached files in the Cloudimage infrastructure and the CDN servers. It consists of several items:

  • at least one copy per original file, stored in the Cloudimage infrastructure
  • all different file transformations of the original file stored in the Cloudimage servers (example: ?w=200&h=200 , ?w=400&h=145&func=fit&bg_colour=000, ?force_format=png, etc)
  • all fallback formats of the same transformation(webp, avif, jpg, png - all fallback formats are generated on the initial request and the smallest is delivered)
  • the CDN servers cache the file transformations and their fallback formats. Please note that the CDN service consists of multiple servers (called Points Of Presence - PoPs), located worldwide. Depending on what image data has been requested from the final users in a specific geographical location, the cache of two PoPs can be different in content and size.

Therefore, assuming a user requests the image:

https://token.cloudimg.io/www.example.com/image.jpg?w=200 

the subsequent Image Cache is being built:

  • a Cloudimage server requests the original image (let's say its size is 10MB) and stores it in its cache
  • then image transformations ?w=200 are created in webp and the fallbacks variants. The webp version is 3MBs and the jpg version is 5MBs. All versions are stored in Cloudimage and webp is chosen to be sent to and then cached from the CDN PoP (3+5=8MB)
  • the CDN delivers the optimized webp version to a user (3MB) and then the fallback jpg version - 5 MBs to another user with Safari browser (it is a known limitation that Safari v.13 does not support webp, that is why jpg needs to be provided)

The final results for this simple example are:

  • total CDN Traffic (in MB) : 3 + 5 = 8 
  • total Image Cache consolidated: 10 (original image) + 3+5 (Cloudimage cache) + 3+5 (CDN cache) = 26MB 

We hope the above explanation clarifies why CDN traffic differs from Image Cache.

If you have any questions or issues, please feel free to contact our Software Engineer and mention the following details:

    • Token
    • Short description of the issue (including URLs, screenshot, short video if available)
    • Steps to reproduce the issue.
Was this article helpful?
1 out of 1 found this helpful

Comments

0 comments

Please sign in to leave a comment.