What is octet-stream?


Under: Content Type Breakdown is are:
empty - I think this is like 301,404,410… Server request
but what is octet-stream?
My first idea was a pdf but the request are to high. I don’t have any file like audi or video files on my server.


As far as i know application/octet-stream is sent with the header and is also used when there are files with an unknown format or missing file extension. This could also happen when downloading MS Word documents for example

Then it’s your browsers decision how to handle this file.


I would gladly answer, but people did it better than I could ever do so:

A MIME attachment with the content type “application/octet-stream” is a binary file. Typically, it will be an application or a document that must be opened in an application, such as a spreadsheet or word processor. If the attachment has a filename extension associated with it, you may be able to tell what kind of file it is. A .exe extension, for example, indicates it is a Windows or DOS program (executable), while a file ending in .doc is probably meant to be opened in Microsoft Word.
No matter what kind of file it is, an application/octet-stream attachment is rarely viewable in an email or web client. If you are using a workstation-based client, such as Thunderbird or Outlook, the application should be able to extract and download the attachment automatically. After downloading an attachment through any of these methods, you must then open the attachment in the appropriate application to view its contents.
Before opening attachments, even from trusted senders, you should follow the guidelines listed in Tips for staying safe online.
In addition to the generic application/octet-stream content type, you may also encounter attachments that have different subtypes (e.g., application/postscript, application/x-macbinary, and application-msword). They are similar to application/octet-stream, but apply to specific kinds of files.

— Indiana University, https://kb.iu.edu/d/agtj


I found the Problem.
All unknown file formats in a appache server are streamed by octet-stream.
pdf an ico was unknown. So I added:

AddType image/webp .webp
AddType application/pdf .pdf
AddType image/x-icon .ico

So the octet-stream counter in analytics goes down and this file formats are show now right.


Thanks for following up with that info… satisfied my ‘learn something new every day’ requirement early today! :smiley:


@cscharff , thx for you replay. So I will go in detail. Here my other Post.
My default setting for header file type on the Apache server (by my Provider, Apache I don’t know) was:

  • pdf no Header Type (Content-type)
  • webp text/plain
  • ico text/plain

So there was two problem.

  1. pdf with no header content-type was sending by octet stream. I don’t know what is mean in effect. After add pdf to the filetype the octet stream switch to other in Analytics (pdf not suport by analytics)
  2. webp and ico was send as text/plain. There was a big problem. Cloudflare compress text/plain with Brotli. Its a bad thing compress images.

My first question was will Clodflare cache the compressed or uncompressed version of this file. I think he cache the uncompress version. Why, I think it? A view in the Search console (old Webmaster Tools) show me the folow graph Time spent downloading a page (in milliseconds) after I enabled webp for images:


Comment to the graph. Add Webp Q4 of April. I don’t purge the hole cache. My cache is one month. After add the line

AddType image/webp .webp
AddType application/pdf .pdf

to the Apache Server (Begin May), the download time goes back to normal time. I think while Clodflare stops compress this files.

If someone from Clodflare read here, here two nice feature.
Add two checkboxed to the speed tab:

  1. corect wrong content-type header like webp. So you and your customer save performance and speed, by don’t compress files like webp, pdf images etc, if the filetype are wrong. Here a nice list of filestype.
  2. add file types where no content-type header is set for known file types. I don’t know the benefits, but hey… its good coding :wink: