IIS Server Technology

How to show .webp files on IIS

By default, Internet Information Services (IIS) does not support serving .webp files out of the box. However, you can enable support for .webp files in IIS by following these steps… (jump to number 3, which might be all that you need!):

  1. Install the WebP image extension: Download and install the WebP image extension for IIS from the official Microsoft website (https://www.microsoft.com/web/handlers/webpi.ashx?command=getinstallerredirect&appid=IISWEBMEDIAEXTENSION). This extension adds support for serving .webp files.
  2. Enable the WebP module in IIS: Open the IIS Manager on your server and navigate to the server level or site level where you want to enable .webp support. Double-click on the “Modules” feature and click “Add Managed Module” from the right-hand actions pane. Enter a name for the module (e.g., “WebPModule”) and specify the following settings:
    • Type: Managed Handler
    • Precondition: Integrated mode
    • Path: C:\Windows\System32\inetsrv\webp.dll
    • Entry Type: Local
  3. Add the MIME type for .webp files: In the IIS Manager, select the server or site level, and open the “MIME Types” feature. Click “Add” from the right-hand actions pane and enter the following details:
    • File name extension: .webp
    • MIME type: image/webp
      MIME type add media .webp and image/webp
  4. Restart IIS: To apply the changes, restart the IIS service or recycle the application pool associated with your website.

After completing these steps, IIS should be configured to serve .webp files. You can test it by accessing a .webp file hosted on your server through a web browser. If everything is set up correctly, the .webp image should be displayed.

Note: It’s essential to ensure that your website’s visitors have compatible web browsers that support the .webp format. If a browser does not support .webp, the image may not be displayed correctly. You can consider providing fallback options or using JavaScript techniques to handle compatibility for unsupported browsers.

You may also like...