Add avif images to default known static file MIME types
See original GitHub issueIs 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:
- Created 2 years ago
- Reactions:4
- Comments:6 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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 😃
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.