by Nicholas Head
29. September 2008 07:28
I know I haven’t written anything in over a month, but I’ve been fairly busy. Things are calming down a little bit, but there is still much to be done. I promise I will post an update when things finally do settle down. In the meantime, enjoy this picture of me riding Dumbo at Disneyland.

42ba9c73-0513-4881-b123-87aeea69cd39|2|2.0
Tags:
by Nicholas Head
29. September 2008 07:19
Tonight I set about trying to get my IIS7 server to serve files with the application/x-javascript content type as compressed. After a bunch of testing, back and forth, ultimately this is what worked for me in my applicationHost.config file:
<dynamicTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/x-javascript; charset=utf-8" enabled="true" />
<add mimeType="application/x-javascript" enabled="true" />
<add mimeType="*/*" enabled="false" />
</dynamicTypes>
You have to be specific it seems, specifying the charset. And it needs to go before the regular x-javascript entry. Go figure. Hopefully this saves someone else some headaches.
Also, while you’re tinkering with applicationHost.config, you might as well change this:
<serverRuntime />
Into this:
<serverRuntime frequentHitThreshold="1" />
That specifies that IIS7 should compress/cache any static content the first time it’s requested. Otherwise, it defaults to “2”, which means it will only cache the compressed content if it’s requested at least 2 times within 10 minutes.