Been updating the mime types of my servers recently as I develop more html content and came across a number that I hadn’t needed to worry about before.
With the advent of font embedding becoming more available outside of IE (been available in IE since version 6) there’s a need to encode and font-face the fonts for the various browsers to render on the client side. Flash has been embedding fonts silently for years and nothing makes your site look more professional than a good short choice of fonts to embed.
Here’s what you need to add to your htaccess file (on apache servers) to allow the client side to download the files from restricted servers (including other media types commonly referenced in HTML5):
AddType application/vnd.ms-fontobject .eot
AddType application/octet-stream .otf .ttf
AddType application/x-font-ttf .ttf
AddType application/x-woff .woff
(WOFF is the new version of EOT. Chrome and IE 9 RC support WOFF. EOT is supported by IE 6-9 Beta).
(OTF/TTF is supported by many other browsers but definitely not IE).
I’ve come across conflicting definitions for TTF — some indicate the octet-stream and other’s indicate x-font-ttf — I’d gone with the latter on my sites but the former is here in case you don’t get the right results with your system.
//For html audio types, you’ll need to add:
AddType audio/mp4 .mp4 .m4a
AddType audio/mpeg .mp3
AddType audio/ogg .ogg .oga
AddType audio/wav .wav
//For video types:
AddType video/ogg .ogm .ogv .ogg
AddType video/mp4 .mp4 .m4v .f4v
AddType video/webm .webm
AddType video/x-flv .flv
// for SWF (Flash) files
AddType application/x-shockwave-flash .swf
AddType application/pdf .pdf
// archive files
application/zip .zip .7z
Mime types are becoming much more important as the browser wars of 2010 continue into 2011/2012 based on some being more adamant that the mime be properly defined on the server.
Some browsers on micro platforms like the embedded systems may become more dependent on the mime as a way of constricting bandwidth or filtering content on low bandwidth or conservative networks.
Also, more advanced client side applications may behave incorrectly if the mime of an asset is not correctly defined (as3 applications which load .swf content into themselves may not issue the correct eventHandler if the asset is considered an image rather than an application).
Just as REST requires browsers to correctly handle server side status codes, so will mime types properly restrict and filter content based on type.
It doesn’t hurt to define the mime types correctly, but it certainly will become an issue if you don’t configure them for the content that you deliver on your sites.