question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add avif images to default known static file MIME types

See original GitHub issue

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

When developing web applications, the size of images is always a factor. Therefore I decided to use the avif file format. When running my web application (Angular + WebApi) with Kestrel, I have to manually add the MIME type to the FileExtensionContentTypeProvider otherwise the static file isn’t served.

Describe the solution you’d like

Please add the extension (.avif) and the MIME type (image/avif) to the dictionary in FileExtensionContentTypeProvider. I can open a PR if wanted.

Additional context

In 2019 the specifications for the avif image format have been released. Meanwhile the format is well supported for example by Chrome, Firefox, Windows, Linux and Android. It is a good candidate for being a successor of jpeg, png and webp also with regard to the open licence.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:4
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

8reactions
blowdartcommented, Feb 10, 2022

I’m going to disagree here @adityamandaleeka. Windows itself supports it, as does php, android, chrome and edge. We should add it, along with HEIC/HEIF.

The usage of these types is more common than a bunch of the office formats we listed when we inherited the list from IIS, or the now dead silverlight ones 😃

0reactions
carlin-q-scottcommented, Feb 9, 2022

I’d like to add that avif files are significantly smaller than jpg of similar resolution. I switched over to using them to greatly improve my LCP metric with Google to improve my site page rank. Just swapping out a header background jpg with an avif saved me almost 2 seconds of load time on the LCP test for mobile Chrome. This file format should be gaining widespread adoption soon.

I don’t think it’s a good idea to have devs tear their hair out trying to figure out why an image asset is returning 404 despite having all the file properties set correctly. I didn’t even know that an asset in the wwwroot folder or subfolders could return a 404 until I found this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to configure your web server to deliver AVIF images
Apache. Apache does not include by default the image/avif or image/avif-sequence MIME types in the standard configuration files.
Read more >
Using Modern Image Formats: AVIF And WebP
In this article, we'll highlight how modern image formats (AVIF or WebP) can improve compression by up to 50% and deliver better quality ......
Read more >
The AVIF Mime Type
Mime Type ) used for AVIF images is image/avif, and the standard file extension is .avif. AV1, or AVIF, is a new image...
Read more >
AVIF browser test page: AVIF support in Chrome, Firefox ...
Test your browser's ability to display AVIF images and get answers on AVIF-related questions: How to convert JPEG to AVIF? How to use...
Read more >
Adding Static Content MIME Mappings <mimeMap>
In the Home pane, double-click MIME Types. In the MIME Types pane, click Add... in the Actions pane. In the Add MIME Type...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found