是否可以在简单的Azure网站上启用gzip压缩? 如果是这样怎么办? 在Azure网站上应用gzip时有什么需要考虑的吗?Windows Azure网站中的gzip压缩
12
A
回答
11
我刚刚检查了一个我的天蓝色网站,它看起来像gzip正在工作。我没有什么特别的web.config,所以我认为它必须默认启用。
3
Per @ DavideB对已接受答案的评论,我发现你可以通过web.config配置Azure/IIS。 [MSDN source]
<configuration>
<system.webServer>
<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
<scheme name="gzip" dll="%windir%\system32\inetsrv\gzip.dll"
doDynamicCompression="true" doStaticCompression="true"
staticCompressionLevel="7" dynamicCompressionLevel="7" />
<staticTypes>
<add mimeType="*/*" enabled="true" />
</staticTypes>
<dynamicTypes>
<add mimeType="*/*" enabled="true" />
</dynamicTypes>
</httpCompression>
</system.webServer>
</configuration>
请注意:
这只会在Azure中工作,或者与IIS安装了正确的功能(例如,如果你使用IISExpress或香草IIS你运气不好,请参阅文章中的正确功能以及本地测试的配置说明)。
静态和动态资源的压缩是独立配置的,并且具有单独的默认值;在实践中,你应该比我更仔细地配置你的mimetypes和压缩级别。
压缩级别介于0和10之间,其中0 == off和10 == maximum;在这里,我将我的设置设置为7,理由是这可能是CPU使用率和压缩率之间的良好折衷。
相关问题
- 1. gzip压缩的网站(JS,CSS,PHP)
- 2. 如何压缩Azure网站
- 3. Azure DocumentDb压缩/ gzip响应
- 4. 通过PHP Gzip压缩到html网站
- 5. 请求GeoCoder网站禁用gzip压缩
- 6. 针对Azure网站上的HTTP 1.0代理请求的gzip压缩
- 7. gzip压缩
- 8. gzip在wordpress站点上的压缩
- 9. AppEngine gzip压缩
- 10. 解压缩GZIP
- 11. TYPO3 gzip压缩
- 12. Gzip解压缩
- 13. javascript gzip压缩
- 14. WP8 Gzip压缩
- 15. 在Qt中解压缩Gzip网络流
- 16. 如何在PHP网站中集成gzip压缩?
- 17. GZIP压缩+ htaccess的紧缩
- 18. PHP中的GZIP压缩
- 19. Protobuf与GZIP压缩
- 20. Gzip压缩的网站不能与IE一起工作
- 21. Objective-C的gzip压缩的NSData到Python gzip压缩串?
- 22. gzip和webpack压缩
- 23. gzip压缩vs ob_gzhandler
- 24. 解压缩GZIP流
- 25. 启用gzip压缩
- 26. Gzip压缩与MockRestServiceServer
- 27. Apache gzip解压缩
- 28. 透明GZIP压缩
- 29. SignalR wth gzip压缩
- 30. 启用GZIP压缩
检查这个帖子http://social.msdn.microsoft.com/Forums/hu-HU/windowsazuredevelopment/thread/a942a5bf-5f23-4b3f-8788-ace9efa5c7b6 –
您是否尝试过通过更改网页,使压缩的.config?请参阅http://stackoverflow.com/a/7171979/209727 –
可能的重复[如何在Windows Azure动态内容上启用gzip HTTP压缩](http://stackoverflow.com/questions/2775261/how-to-enable- gzip-http-compression-on-windows-azure-dynamic-content) –