WebP is an image format that provides superior lossless and lossy compression, animation and alpha transparency developed by Google in 2010. By using WebP developers can gain better-compressed images than JPG or PNG, in turn, providing better overall performance on the web.
Serving static WebP files requires a minor addition to your site's .htaccess file to tell Apache and Drupal what to do with files ending with the .webp file extension.
Drupal's .htaccess file is located in your codebase's docroot. Within your .htaccess file, you will need to add the following line in order to properly set the WebP MIME type:
# Add webp MIME type so that Apache knows how to handle WebP images
AddType image/webp .webp
Once your updated .htaccess file is deployed, you should then be able to view WebP files being served from Drupal, and be well on your way to improving site performance and impressing your visitors with a snappier website!
The following example uses the stock Drupal image styles and the GD Image Toolkit settings:
If you're not using the stock Drupal core image styles, but other options like https://www.drupal.org/project/imageapi_optimize_webp then you'd need to configure those modules to use the GD Image Toolkit if possible. (For further instructions, consult their documentation and/or Issue Queues in Drupal.org).
Note that some Drupal image-manipulation modules have been coded to only work with ImageMagick or other commands/tools. Those modules will not be compatible with WebP images on Acquia Cloud.
If this content did not answer your questions, try searching or contacting our support team for further assistance.
Wed Oct 22 2025 08:59:29 GMT+0000 (Coordinated Universal Time)