Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated mime type for binary buffer #1180

Closed
wants to merge 1 commit into from

Conversation

sbtron
Copy link
Contributor

@sbtron sbtron commented Dec 13, 2017

The registration request is still pending with IANA but getting the PR started for issue #944

In addition to switching to a specific MIME type do we also want to change the recommended extension (.bin) to something else?
My current thinking is rather than creating a new extension we can keep the recommended extension to .bin but add an implementation note that the implementations could chose to have a different extension if they wanted. This would essentially mean any glTF loader should not explicitly check for a .bin extension and simply load whatever filename the buffer uri points to.

@emackey
Copy link
Member

emackey commented Dec 14, 2017

Consider that most web servers serve static files using a lookup table to map file extensions to HTTP MIME type headers. One cannot reasonably expect web servers to be reconfigured to serve all *.bin files as application/gltf-buffer. Most web servers ship pre-configured to serve .bin as application/octet-stream.

For example, see the 6th entry in this table: MDN's Incomplete List of MIME Types

Apache's list: https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types

application/octet-stream	bin dms lrf mar so dist distz pkg bpk dump elc deploy

We cannot save anything to a *.bin file on disk, put it on a web server, and expect the server to serve anything other than application/octet-stream.

@emackey
Copy link
Member

emackey commented Dec 14, 2017

IIS 7 does this too:

            <mimeMap fileExtension=".bin" mimeType="application/octet-stream" />

(Taken from %windir%\system32\inetsrv\config\applicationHost.config)

@donmccurdy
Copy link
Contributor

donmccurdy commented Dec 14, 2017

Do we know if common servers like Apache or Nginx have rules for classic extensions like OBJ, DAE, or FBX?

@emackey
Copy link
Member

emackey commented Dec 14, 2017

Do we know if common servers like Apache or Nginx have rules for classic extensions like DAE or FBX?

They do not, and perhaps we should nudge them to add .glb and such.

But my objection here is that many servers, including at least Apache and IIS, already do have factory rules for *.bin, and it is not OK for us to override that.

@donmccurdy
Copy link
Contributor

But my objection here is that many servers, including at least Apache and IIS, already do have factory rules for *.bin, and it is not OK for us to override that.

Makes sense. Just trying to gauge the likelihood of their handling .glb or a possible replacement for .bin appropriately.

@emackey
Copy link
Member

emackey commented Dec 14, 2017

So, to serve glTF correctly, one must manually add the corresponding MIME types to the server configuration. Moving away from bin and octet-stream just makes one more custom thing that needs registration.

Cesium registers all glTF-related files here for IIS and here for Node Express. Neither one needs to register bin to get this working, as bin is already registered.

@sbtron
Copy link
Contributor Author

sbtron commented Dec 14, 2017

Great points. Open suggestions for an alternative extension
.buf ??

@donmccurdy
Copy link
Contributor

couple more ideas in no order

  • .glbin
  • .glbuf

@emackey
Copy link
Member

emackey commented Dec 19, 2017

No particular preference on my part. I like .glbin, since it seems like we could more easily explain the rename from bin. But any of these seems fine.

@bghgary
Copy link
Contributor

bghgary commented Dec 19, 2017

I don't have a strong preference either, but I prefer the extension to be easily distinguishable from .glb since GLB files can also reference external binary files. Both .glbin and .glbuf start with .glb. Is that confusing?

@donmccurdy
Copy link
Contributor

I don't have a strong preference either, but I prefer the extension to be easily distinguishable from .glb

Since .glb is Binary glTF I could see .glbin causing confusion. .glbuf seems pretty distinct despite having the same first three letters IMO. Or we could consider more explicit alternatives like .gltfbuffer.

@pjcozzi
Copy link
Member

pjcozzi commented Jan 25, 2019

@sbtron? 😄😄😄

@lexaknyazev
Copy link
Member

Superseded by #1877.

@lexaknyazev lexaknyazev closed this Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants