大家好!!!!
请问Azure中website如何使用gzip压缩(或者类似的技术)?
求解答!!!!
azure本身不关心压缩,是你使用的web server来设置使用gzip等
您好,
可以使用。
您需要在webconfig中对该功能进行配置,如下:
添加这段代码,表示您在应用程序级别对您的动态和静态内容进行压缩:
<system.webServer>
<urlCompression doStaticCompression="true" doDynamicCompression="true" />
</system.webServer>
然后再指定您要压缩的动态或者金泰的MIME:
<httpCompression>
<dynamicTypes>
<clear />
<add enabled="true" mimeType="text/*"/>
<add enabled="true" mimeType="message/*"/>
<add enabled="true" mimeType="application/x-javascript"/>
<add enabled="true" mimeType="application/javascript"/>
<add enabled="true" mimeType="application/json"/>
<add enabled="false" mimeType="*/*"/>
<add enabled="true" mimeType="application/atom+xml"/>
<add enabled="true" mimeType="application/atom+xml;charset=utf-8"/>
</dynamicTypes>
<staticTypes>
<clear />
<add enabled="true" mimeType="text/*"/>
<add enabled="true" mimeType="message/*"/>
<add enabled="true" mimeType="application/javascript"/>
<add enabled="true" mimeType="application/atom+xml"/>
<add enabled="true" mimeType="application/xaml+xml"/>
<add enabled="true" mimeType="application/json"/>
<add enabled="false" mimeType="*/*"/>
</staticTypes>
</httpCompression>
建议您参考这几个post:
和
希望能够帮助到您。
Regards,
Will
如果您想进一步了解Windows Azure, Windows Azure 官网欢迎您的访问