How to add Mime Type

Discussion in 'Site & Server Administration' started by cryoffalcon, Jun 7, 2012.

  1. #1
    I went into the cpanel of hostgator and over there they allow to use specific mime types for Gzip compression. Earlier I was using the option to compress all but the result was horrible, Gzip was hurting the flash files and they were not working properly, so now I have decided to use mime types.
    I have found the following format give in the space where I will enter more mime types in host gator, it is like this

    text/html text/plain text/xml

    by looking at it I think to add another mime type to it, all one need to do is to add space to it but I am not sure. So I wanted to know how exactly it is done, is my assuption correct.

    e-g if I want to add mime type for Javascript will it be like this

    text/html text/plain text/xml application/x-javascript

    I got this mime type of javascript from the below link
    http://www.feedforall.com/mime-types.htm

    My target files are only two = Javascript and CSS
     
    cryoffalcon, Jun 7, 2012 IP
  2. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #2
    Mime-type should be the same as your type="" statement in your markup!

    So "text/css" for CSS, and "text/javascript" for scripts. Nobody in their right mind uses the "application/" rubbish, except the handful of whackjobs who seem to think XHTML 1.1 is actually real world deployable and the other nutters who seem to think the whole 'web application' rubbish is actually a good thing. (as opposed to those of us for whom web applications on things like email has sent us screaming back to local mail clients)

    I'd suggest the following list:
    text/css text/javascript text/html text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon application/json
     
    deathshadow, Jul 20, 2012 IP