How to control image format delivery with using the force_format parameter

Description:

This article explains how to use the force_format parameter to control image delivery in specific formats. With force_format, users can enforce a preferred file format, such as WebP, JPG, or PNG, for optimized image delivery. While WebP is highly efficient in reducing file sizes, other formats might be more suitable for specific cases. The force_format parameter options allow users to select the desired format based on needs, balancing flexibility with strict format delivery.

Parameter Options:

The force_format parameter can be set to various formats, including WebP, JPG, and PNG, by appending it directly to the image URL.

Below are examples of how to use force_format with different formats:

1- force_format=webp

  • This parameter enforces WebP delivery when added directly to the image URL.
    In some rare cases, the WebP compression algorithms may produce a WebP file which has bigger filesize than the corresponding JPG resizing. In such cases the system will deliver JPG as final output (but your asset will be better optimized)
  • Recommended: This option is more flexible and "smart" because it automatically optimizes delivery for the smallest file size.

2- force_format=_webp

  • This parameter strictly enforces WebP delivery, even if the resulting WebP file is larger than the original format.
  • This option should be used only when WebP delivery is mandatory, as it may impact performance by delivering larger files.

3- force_format=jpg or force_format=png

  • These parameters enforce JPG or PNG delivery, respectively, ensuring images are delivered in the specified format.

Format "chaining" with force_format:

The force_format option also supports chaining multiple preferred formats for delivery.
For example, you can specify multiple formats in a priority order, such as force_format=webp,jpg,png.
If WebP is not supported by the requestor (due to software limitations or older browser versions), the system will attempt to deliver the image in the next available format in the chain.

Examples:

Additional Notes:

  • We recommend using force_format=webp for most cases, as it prioritizes the smallest file size.
  • Use force_format=_webp cautiously, as it bypasses size optimization and can impact performance.

Need Assistance?

If you have any questions or encounter issues, please feel free to contact our Support Team. When reaching out, include the following details for a quicker resolution:

  • Token
  • Brief description of the issue (including URLs, screenshots, or short videos if available)
  • Steps to reproduce the issue
Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.