IT Nota

  • Home
  • How To
  • .NET
  • WordPress
  • Contact
You are here: Home / How To / How to Serve WebP Image on IIS

How to Serve WebP Image on IIS

As most web users are using Chrome as their default browser how do you take advantage of serving WebP image from IIS server?

The problem with using IIS Server is by default IIS does not recognize WebP as an image type so it cannot correctly render it on the page even if the browser can support it.

Using a test page webp-test.html with the content below, the page will render as shown.

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>IT Nota WebP Test Render</title>
</head>
<body>
  <h1>PNG</h1>
  <img src="images/caniuse-WebP-Test.png" width="368" height="335" alt="PNG" />

  <h1>WebP</h1>
  <img src="images/caniuse-WebP-Test.webp" width="368" height="335" alt="WebP" />
</body>
</html>

IIS failed to render WebP format

The issue stems from the fact that IIS does not recognize WebP as a legitimate MIME type. So with a simple fix, we can make IIS to treat the new format as a valid image file.

How to Enable WebP on IIS

  1. Launch IIS Manager.

  2. Click on your main server on the left pane to make sure we’re making the change on a server level (as opposed to a site level). Then click on the MIME Types.

    IIS Manager MIME type setting

  3. On the right pane of MIME Types dialog box, click on Add… link.

    IIS Manager Add a new MIME Type

  4. We want to add a new MIME type of WebP as an image type so IIS knows how to handle this new format.

    In Add MIME Type box, enter .webp as the file name extension and image/webp as the MIME type and click OK.

    IIS Manager add new MIME type WebP as image/webp

That’s all there is to it.

Now if you reload your Chrome browser, you should be able to see both image files rendered correctly.

WebP rendered from IIS successfully

As a side note, the file size for the PNG is 62.4KB, while the WebP is 29.8KB (52% smaller) with lossless compression using cwebp with the following command line.

C:\> cwebp -lossless -exact caniuse-WebP-Test.png -o caniuse-WebP-Test.webp

You can use the same step to configure IIS to serve AVIF image type as well.

Further Reading

A new image format for the Web
How to Serve WebP Image Format with Fallback for Other Browsers
How to Serve AVIF Image on IIS
How to Serve AVIF Image Format with Fallback for Other Browsers
How to Serve Outlook File Type on IIS

Download

Downloading and Installing WebP Converter

April 7, 2017 Filed Under: How To Tagged With: IIS, Internet Information Services, Microsoft

Buy me a coffee?

Buy me a coffee If you find any of the articles or demos helpful, please consider supporting my work here, you'll have my big thanks!

Comments

  1. IMBMS Shiva says

    June 1, 2023 at 2:18 am

    This article helped for me thank you

    Reply
  2. Arius says

    January 2, 2023 at 1:32 pm

    Looks like I finally found the holy grail of my webp incompatibilities.
    Never knew it was my IIS all that time. Happy new year!

    Reply
    • platt says

      January 3, 2023 at 10:29 pm

      Glad that solved your issue. Happy New Year to you as well!

      Reply
  3. bbue says

    June 9, 2022 at 9:22 pm

    thanks!! it’s really helpful!!

    Reply
  4. waqar says

    March 24, 2022 at 5:01 am

    This helped me. I appreciate it.

    Reply
  5. Shannon S says

    March 8, 2022 at 12:48 pm

    This helped me. I apreciate it.

    Reply
    • platt says

      March 9, 2022 at 1:40 pm

      That’s great to hear. Thanks for your feedback, Shannon.

      Reply
  6. samim says

    February 4, 2021 at 5:05 am

    THANKS A lOT

    Reply
  7. Umair Ahmed says

    July 21, 2020 at 10:50 am

    Thanks! It was always strange to find that webp never worked for our windows servers… How strange that this is still not supplied by Microsoft themselves.

    Reply
    • platt says

      July 23, 2020 at 6:02 pm

      Microsoft is not known to be the fastest in adapting new technology. That goes for for WebP, TLS 1.3 (or even 1.2), and HTTP/3. I hope they’re going to be quicker in doing so. At least in this case, it’s flexible enough to make our own change.

      Reply
  8. Anjani Gupta says

    January 17, 2019 at 3:35 am

    thank you for sharing this knowledgeable content it is very helpful for my website

    Reply
    • platt says

      January 19, 2019 at 2:50 pm

      You’re welcome Anjani.

      Reply

Leave a Reply to IMBMS Shiva Cancel reply

Your email address will not be published. Required fields are marked *

Buy me a coffee Support this site
Buy Me a Coffee?

Categories

  • .NET
  • Coding
  • Cybersecurity
  • Database
  • How To
  • Internet
  • Multimedia
  • Photography
  • Programming
  • Resources
  • Review
  • Tips and Tricks
  • Uncategorized
  • Use Case
  • WordPress
  • Writing

Recent Posts

  • How to View Stored Procedure Code in SQL Server
  • How to Find a String in SQL Server Stored Procedures
  • How to Remove Cached Credentials without Rebooting Windows
  • ESP Work Automation: Empowering Enterprises with Streamlined Workflows and Operational Efficiency
  • How to Search for a String in All Tables in a Database

Recent Posts

  • How to View Stored Procedure Code in SQL Server
  • How to Find a String in SQL Server Stored Procedures
  • How to Remove Cached Credentials without Rebooting Windows
  • ESP Work Automation: Empowering Enterprises with Streamlined Workflows and Operational Efficiency
  • How to Search for a String in All Tables in a Database

Tags

.NET .NET Core AdSense ASP.NET Cdonts Dll Classic ASP Code Editor ETL FSharp Genesis Framework Git Google HP Asset Manager HTML5 Hugo IIS Information Security Internet Internet Information Services iOS JAMStack Linux macOS Microsoft Microsoft SQL Server MVC PHP PowerShell Python Simple Mail Transfer Protocol Smtp Server SQL SQL Server SSIS SSMS SSRS Sublime Text Visual Studio Visual Studio Code VPN Windows Windows 8 Windows 10 Windows 2012 Windows Server

Copyright © 2011-2025 IT Nota. All rights reserved. Terms of Use | Privacy Policy | Disclosure