[nginx] Update mime-types
Maxim Dounin
mdounin at mdounin.ru
Mon Sep 1 01:20:52 UTC 2025
Hello!
On Mon, Aug 25, 2025 at 10:30:42PM +0300, Lafiel via nginx-devel wrote:
> Maxim Dounin писал(а) 2025-07-28 13:54:
> > Hello!
> >
> > Does it make sense to use these extensions nowadays?
> >
> > If yes, how the consumers of these formats will react to the
> > change - that is, is the "application/vnd.palm" type actually
> > supported, or it's just a planned change which never happened
> > in practice?
> >
> > Note that Apache uses "application/x-mobipocket-ebook" for
> > "prc" (which is a prc-based ebook format), which suggests that
> > "application/vnd.palm" might not work well at least for some
> > consumers.
> >
> > If no, should it be removed instead?
> >
> > Also note that at least one common use of the "pdb" extension
> > is a debug data for Microsoft C++ Compiler, and it's actively
> > used in practice.
>
> I agree, some types are rarely used now. Then maybe it should be
> removed?
That's the question. The answer depends on many factors, and in
general requires a separate research.
> There are other rarely used types. Example:
> $ awk '/^mml,/||/^jad,/||/^wml,/||/^jar,/||/^war,/||/^ear,/||/^hqx,/|| \
> /^odg,/||/^odp,/||/^ods,/||/^odt,/||/^wmlc,/||/^wasm,/||/^cco,/|| \
> /^jardiff,/||/^jnlp,/||/^sea,/||/^sit,/||/^xpi,/||/^xspf,/|| \
> /^ra,/||/^3gp,/||/^asf,/' ~/httparchive_exts.csv
> 3gp,35,75
> wml,11,63
> odt,16,23
> jar,5,12
> wasm,5,9
> sea,2,8
> xspf,4,7
> asf,4,6
> odg,2,3
> ra,3,3
> war,1,1
> jnlp,1,1
> cco,1,1
> hqx,1,1
> ods,1,1
In general, the threshold for removing types should be much lower
than the threshold for adding new types, since this might
negatively affect existing uses, breaking POLA.
Additionally, the particular examples demonstrate that httparchive
stats shouldn't be the only factor to consider: for example,
"wasm" is a perfectly active and only recently introduced
extension for Web Assembly, while "wml" is a dead format for WAP
sites, no longer used in practice. The fact that "wml" is
apparently used more than "wasm" shows that the data might not be
a good indicator of relative usage, at least in the area where the
usage is low.
Also, the "odg", "odp", "ods", and "odt" are extensions for
OpenOffice document formats. Such files aren't often used for sites
itself, but might be available for download, which makes them
important for mime.types, but unlikely to appear with high numbers
in httparchive data. I believe we've previously discussed this
in this thread, here:
https://freenginx.org/pipermail/nginx-devel/2024-March/000099.html
In either case, removing of any type certainly needs a detailed
research, demonstrating that the type is no longer used in
practice.
> > Numbers as I see them suggests that all these extensions are
> > rather not used in practice, at least compared to "ts".
> >
> > Further, I would argue that "tsv" is a common extension for tab
> > separated values format, and both Python and Apache map it to
> > "text/tab-separated-values".
> >
> > I would rather refrain from this change.
>
> Maybe then just add the text/tab-separated-values type for .tsv files?
>
> $ awk '/^tsv,/' httparchive_exts.csv
> tsv,174,326
That would be something I would rather accept if requested. On
the other hand, tab separated values are most likely fine with
any default type, such as "text/plain" or "application/binary",
and this explains lack of requests to add this type and extension.
> > See here about m4v/m4a as discussed earlier in this thread:
> >
> > https://freenginx.org/pipermail/nginx-devel/2024-April/000141.html
> >
> > Note well that this patch doesn't remove corresponding
> > "video/x-m4v" type with the "m4v" extension, which makes the
> > change essentially a nop (apart from producing a warning at
> > startup).
>
> Forgot to delete video/x-m4v.
>
> If there were any problems, then Apache would not have added
> the `audio/mp4` type for .m4a and mp4a files.
As previously explained, using "audio/mp4" and "video/mp4" for
"m4a" and "m4v" files is incorrect, as these are distinct types.
As such, the question is what are the reasons for the change.
Just for the record, the Apple site does not seem to be
distinctive about what types they expect to be used. In
particular, I was able to find the following pages with MIME type
recommendations for m4v/m4a files on developer.apple.com:
https://developer.apple.com/library/archive/documentation/AudioVideo/Conceptual/AirPlayGuide/PreparingYourMediaforAirPlay/PreparingYourMediaforAirPlay.html
https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/CreatingVideoforSafarioniPhone/CreatingVideoforSafarioniPhone.html
https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/CreatingContentforSafarioniPhone/CreatingContentforSafarioniPhone.html
The first one, last modified in 2012, suggests to use
"audio/mpeg4" and "video/mpeg4". Two others, last modified in
2016, suggests to use "audio/x-m4a" and "video/x-m4v".
I personally tend to think, especially given the last link from
the above, which contains a number of various types, including
"audio/x-m4b" for "m4b" and "audio/x-m4p" for "m4p", that
"audio/x-m4a" and "video/x-m4v" should be preferred.
Still, I'm open to changes if some compelling reasons are
provided.
> > The numbers suggests that these extensions are not used in
> > practice.
> >
> > And at least "movie" is a way too generic extension seen being
> > used with other MIME types, notably "video/x-sgi-movie" in Apache
> > and Python.
> >
> > We probably can consider adding just the "qt", but given the
> > numbers I'm not sure it worth the effort.
>
> Apache also has such an extension, I think it's worth adding.
> I can fix the patch later.
>
> $ awk '/video\/quicktime/' mime.types
> video/quicktime qt mov
I don't have any strong objections. Still, I'm not really
convinced this extension is used in practice, and if it is, it is
mostly used for QuickTime videos, and not for other purposes.
> > At least Apache still uses "video/x-ms-asf". And the change
> > looses details about the purpose of the file format, which might
> > be the reason why "video/x-ms-asf" is still used.
> >
> > Any specific reasons for the change?
>
> According to this recommendation:
> https://learn.microsoft.com/en-us/windows/win32/wmformat/file-name-extension-guidelines
> asf files should not store audio and video streams.
> This format is also rarely used, can it be removed as well?
> This also applies to the .wmv extension. Then there will be
> no need to add the .wma extension.
As suggested above, threshold for removing extensions which are
already present is expected to be much lower than that for adding
new extensions. And at least "wmv" files are still widely used in
practice, as far as I can tell, e.g., from various video sharing
sites.
[...]
--
Maxim Dounin
http://mdounin.ru/
More information about the nginx-devel
mailing list