webp images not showing up in App Service

Satyam Chauhan 587 Reputation points
2024-03-21T06:13:54.7733333+00:00

Hi,

I have an Angular application, where I have used webp image format as recommended in page speed insight test. On running the application locally, the webp images are loading fine but when I am deploying the same application to an azure app service I get the error - 404 not found for the images.

Please help, how can I fix this error.

Thanks

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,030 questions
0 comments No comments
{count} votes

Accepted answer
  1. Achraf Ben Alaya 1,056 Reputation points MVP
    2024-03-21T08:15:57.0966667+00:00

    Hello ,
    You can do this by adding a Web.Config file (if one doesn’t already exist) to your wwwroot folder which contains a mapping from the webp extension to the (image/webp) mime type.
    Example :

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
     <system.webServer>
        <staticContent>
          <mimeMap fileExtension="webp" mimeType="image/webp" />
        </staticContent>
     </system.webServer>
    </configuration>
    
    

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.