Tags

Assets
API

Asset CDN

In the asset details view, you can find the download button on the right side. Clicking on it will reveal the image URL, which you can use to directly access the image through the Asset CDN. The Asset CDN supports on-the-fly resizing and format optimization to deliver the best possible image to your users, no matter where they are located. Additionally, the assets are cached at the edge for fast and efficient delivery.

The base URL of the image might look like this:

https://assets.caisy.io/assets/24f83c2f-4d07-4666-84ca-420f9ab91dec/519eb852-8fd2-4b31-8dcc-1c2217f71b7f/db8c2d70-e1a0-44c7-a4c7-a1e3c85cf261b8552817fb18469ca06cc1b7da705c37dold1955.jpg

The base URL will return the image in its original size, but it will be converted to WEBP if the browser supports it, based on the HTTP headers

Cropping


If you want to crop the image to a specific width, you can add the following to the URL: ?w=200

https://assets.caisy.io/assets/24f83c2f-4d07-4666-84ca-420f9ab91dec/519eb852-8fd2-4b31-8dcc-1c2217f71b7f/db8c2d70-e1a0-44c7-a4c7-a1e3c85cf261b8552817fb18469ca06cc1b7da705c37dold1955.jpg?w=200

If you want to crop the image to a certain height (h), you can add h=200 to the URL.
Additionally, you can use both width and height by specifying w=100&h=100.
To control the quality of the image, you can specify the q parameter, such as q=80. The default quality is 99.

Format

Our image API automatically detects if your browser supports the WebP image format by inspecting the Accept HTTP header. If WebP support is detected, the API will return images in the WebP format, automatically converting them from JPEG or PNG formats. This ensures optimal image quality with reduced file sizes, resulting in faster page load times and improved user experience.

Support

Our image API currently supports resizing for the following formats: JPEG, PNG, GIF, and WebP. When you request a resize operation for an image in one of these formats, the API will process the request and return the resized image accordingly. However, if the image is in a format other than those listed, the API will ignore the resize operation and return the file in its original, as-uploaded state. This ensures that unsupported formats remain intact and unaltered, providing a consistent user experience across various content types.

Tags

Assets
API