问题描述
我有一个网站,它使用ASP.NET并在IIS 7.5托管共享主机,所以我必须要IIS设置直接访问。现在,我想启用使用IIS功能,我的网页和CSS / JS文件gzip的COM pression,但没有在网上查到的食谱为我工作。例如,当我加写的是什么的我的web.config,没有什么变化:没有错误,没有COM pression。
I have a web-site, which uses ASP.NET and is hosted at IIS 7.5 shared hosting, so I have no direct access to IIS settings. Now I want to enable gzip compression of my pages and css/js files using IIS capabilities, but none of recipes found at the Internet worked for me. For example, when I add what is written here to my Web.config, nothing changes: no errors, no compression.
这可能吗?如果没有,什么是最好的选择呢?
Is this possible? If not, what's the best alternative?
推荐答案
在本文下方尝试配置示例:
Try the configuration sample at the bottom of this article:
<configuration>
<system.webServer>
<urlCompression doStaticCompression="true" doDynamicCompression="false" />
</system.webServer>
</configuration>
在此<一个href=\"http://stackoverflow.com/questions/1324481/setting-the-gzip-com$p$pssion-in-asp-net\">question它说:
是的,你可以启用COM pression与web.config中,如下shows-的文章,但它可以依靠的权限在服务器允许的网站。
"Yes you can enable compression with the web.config, as the article below shows- but it can depend on the permissions on the server allows sites."
看看这可以帮助你:
或者这样:
这篇关于IIS 7.5的gzip COM pression在共享主机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!