asp.net – 在Azure网站上启用gzip压缩
发布时间:2021-03-31 04:27:54 所属栏目:asp.Net 来源:互联网
导读:我有一个使用标准层在azure网站上运行的ASP.NET应用程序.我一直试图让gzip压缩工作.我修改了我的web.config文件,并在system.webServer下添加了以下内容 urlCompression doStaticCompression=true doDynamicCompression=true/httpCompression directory=%Syst
|
我有一个使用标准层在azure网站上运行的ASP.NET应用程序.我一直试图让gzip压缩工作.我修改了我的web.config文件,并在system.webServer下添加了以下内容 <urlCompression doStaticCompression="true" doDynamicCompression="true"/>
<httpCompression directory="%SystemDrive%inetpubtempIIS Temporary Compressed Files">
<dynamicTypes>
<add mimeType="text/*" enabled="true"/>
<add mimeType="message/*" enabled="true"/>
<add mimeType="application/javascript" enabled="true"/>
<add mimeType="application/x-javascript" enabled="true"/>
<add mimeType="*/*" enabled="false"/>
</dynamicTypes>
<staticTypes>
<add mimeType="text/*" enabled="true"/>
<add mimeType="message/*" enabled="true"/>
<add mimeType="application/javascript" enabled="true"/>
<add mimeType="application/x-javascript" enabled="true"/>
<add mimeType="*/*" enabled="false"/>
</staticTypes>
</httpCompression>
这在使用IIS express本地运行时有效,但在部署到azure时不起作用.响应包含以下标头. Accept-Ranges:bytes Content-Length:5381 Content-Type:text/css Date:Fri,04 Sep 2015 20:44:01 GMT ETag:"56386b2e88dad01:0" Last-Modified:Wed,19 Aug 2015 14:06:02 GMT Server:Microsoft-IIS/8.0 X-Powered-By:ASP.NET 解决方法你错过了< scheme>元件<scheme name="gzip" dll="%Windir%system32inetsrvgzip.dll" /> 更多信息: https://www.iis.net/configreference/system.webserver/httpcompression/scheme <urlCompression doStaticCompression="true" doDynamicCompression="true"/>
<httpCompression directory="%SystemDrive%inetpubtempIIS Temporary Compressed Files">
<scheme name="gzip" dll="%Windir%system32inetsrvgzip.dll" />
<dynamicTypes>
<add mimeType="text/*" enabled="true"/>
<add mimeType="message/*" enabled="true"/>
<add mimeType="application/javascript" enabled="true"/>
<add mimeType="application/x-javascript" enabled="true"/>
<add mimeType="*/*" enabled="false"/>
</dynamicTypes>
<staticTypes>
<add mimeType="text/*" enabled="true"/>
<add mimeType="message/*" enabled="true"/>
<add mimeType="application/javascript" enabled="true"/>
<add mimeType="application/x-javascript" enabled="true"/>
<add mimeType="*/*" enabled="false"/>
</staticTypes>
</httpCompression> (编辑:东莞站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- asp.net-mvc – 使用asp.net mvc 2功能与火花浏览引擎
- ASP.Net 2中的上传文件在哪里?
- asp.net-mvc-routing – 在MVC 6控制器中使用urlhelper生成
- asp.net-mvc – ASP.Net [HiddenInput]数据属性在Razor中用
- ASP.Net核心 – 获取帖子表格的所有数据
- asp.net-mvc-3 – 如何避免使用MVC3 FileContentResult重复
- asp.net-mvc – 如何使用ASP.NET MVC ApiController获取GET
- asp.net-mvc – 为什么我在带有godaddy服务器的MVC3应用程序
- asp.net-mvc – 存储库与DAL中的服务模式:EF和Dapper
- asp.net-core – 如何在Visual Studio 2015 RC中为ASP.NET
推荐文章
站长推荐
- asp.net-mvc – 使用AD的ASP.NET MVC表单Auth在本
- asp.net-mvc – 为一个MVC视图使用两个强类型模型
- asp.net – 将ViewState移出页面?
- ASP.NET基于Ajax的Enter键提交问题分析
- asp.net html控件的File控件实现多文件上传实例分
- asp.net-mvc – 使用Viewbag绑定DropdownlistFor
- ASP.NET SQL成员资格表
- asp.net-mvc-3 – Url.Action没有给出预期的结果
- asp.net – 应用程序池在iisreset之后无法启动
- asp.net – coldfusion和.net上的单点登录
热点阅读
