asp.net – 在Azure网站上启用gzip压缩
发布时间:2021-03-30 18:24:35 所属栏目: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/C++#:可以使用Html.ActionLin
- 点击图片,AJAX删除后台图片文件的实现代码(asp.net)
- ASP.Net Web应用程序安全性不适用于IIS 7?
- IIS ASP.NET WebApi在请求同一台服务器时死锁
- asp.net-mvc – ActionResult上的自定义属性
- ASP.NET批量下载文件的方法
- asp.net – 是否可以在源代码中使用iframe和localhost地址?
- asp.net-mvc – mvc razor @helper可以返回非编码标签吗?
- asp.net Xml绑定到数据控件的具体实现
- 单元测试 – 如何在ASP MVC 5(Microsoft.AspNet.Identity)中
推荐文章
站长推荐
- 集成ASP.NET Webforms,WebAPI和AngularJS
- asp.net-mvc – 为什么MVC4捆绑捆绑Knockout.js?
- asp.net-mvc – MVC导航到不同的控制器视图
- asp.net-mvc – 在asp.net mvc 3剃刀中识别html助
- asp.net – 在剃刀中等同于End / Response.End?
- 从ASP.NET应用程序使用Active Directory时,Direc
- 在ASP.NET MVC4中是否可以将C#或VB函数标记为Jav
- asp.net-mvc-3 – MVC3视图继承不可能?
- asp.net文件上传功能(单文件,多文件,自定义生成
- asp.net – 我可以愚弄HttpRequest.Current.Requ
热点阅读