Is there an IANA media type for Brotli compression? - media-type

For gzip, there is an IANA media type "application/gzip" and an HTTP content encoding abbreviation "gzip".
For Brotli, there is a content encoding "br". Is there an IANA media type for Brotli compressed data? If not, why not?
pvde

Related

Firefox ignores "video/quicktime" MIME Type for file input

I have a form with a file input to handle file uploads for images or videos. I want to restrict the accepted file-types to .jpg, .gif, .png, .mp4 and .mov, so I'm using the accept option on my input type="file" as follows:
<input name="message[file]" accept="image/jpeg,image/png,image/gif,video/mp4,video/quicktime" type="file">
This works basically fine, but Firefox seems to ignore the video/quicktime MIME type and the file dialog box shows the .mov files as unavailable. All the other accepted file types are available.
I can select the .mov files when I use video/* as accepted file-types, but I want to restrict the video-uploads to .mp4 and .mov. According to my research video/quicktime is the correct MIME type for .mov files and the WebKit-Browsers work well with it. Why would Firefox not accept the .mov files?
Only MP4, WebM, and Ogg video are supported by the HTML5 standard. Starting from Firefox 45, video/quicktime content type is treated as MP4 media to be handled by the built-in HTML5 video player. But MOV files can contain a variety of different encodings, they are not all MP4.

Data compression libraries: brotli vs zlib

Which data compression works best for compressing javascript files when downloaded from any website: brotli or zlib ?
I'll assume that by "javascript files" you mean javascript source code.
brotli (content encoding "br") is better for non-dynamic content, where you expect it to be compressed once, but transmitted and decompressed many times. That would normally be the case for javascript. The average gain is about 20% for javascript code.
Not all clients accept brotli (so far Firefox, Chrome, and Edge do). If the client doesn't accept it, then the encoding negotiation will automatically fall back to content encoding gzip (what zlib produces).

What MIME-type to use as general purpose?

I have a PHP script that I use to download different types of files (PDF, JPEG, RAR end other). Works great, however I noticed an issue there with the MIME-type.
Is there a universal MIME-type I can safely use for "general purpose"? I am thinking of application/octet-stream for all file types.
Or should I do the MIME for each file type individually?
It's supposed to deliver downloads, it's not important to open the files in apps directly.
If you just want to deliver files and don't care about the type of application needed to open it, then it's safe to specify the file mime type as application/octet-stream. However you should specify that it should be saved and should not be attempted to be opened inline within the browser.
you should specify the header as:
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="file.png"
It informs the browser (or the client application) that the file should be downloaded and should not be attempted to be opened inline.

Correct MIME type for multipart MJPEG stream over http?

Chrome always throws a warning for my MJPEG stream:
Resource interpreted as Image but transferred with MIME type multipart/x-mixed-replace
Is there maybe a better MIME type to use that can fix this? Can I just use 'Image', even though it IS a multipart stream?
From different resources across the web, the more commonly employed MIME type for M-JPEG i.e. Motion JPEG is video/x-motion-jpeg. Only GStreamer has a slightly different view as it employs video/x-jpeg as indicated in this table of video MIME types.
The web resources for MJPEG MIME types are:
htmlquick
sitepoint
Harvard Site
IBM Site

Can the image/jpeg library in Go support JPEG progressive format

The Go runtime (the version that is in google appengine) package image/jpeg returns "unsupported JPEG feature: progressive mode" when trying to Decode a JPEG that uses progressive format. Is this an error on my part? Or is this type of JPEG not yet decodable in Go?
It will be included in the upcoming Go 1.1 release.
Revision: 51f26e36ba98: image/jpeg: decode progressive JPEGs.

Resources