IE 在 IIS7 中加扰脚本并打开静态压缩

IE scrambles script in IIS7 with static compression turned on(IE 在 IIS7 中加扰脚本并打开静态压缩)
本文介绍了IE 在 IIS7 中加扰脚本并打开静态压缩的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了 javascript 文件在 IIS7 中未解压缩和样式表未正确加载的问题.

I am having issues with javascript files not decompressing in IIS7 and stylesheets not loading properly.

我可以通过在 IIS 中关闭静态压缩来解决此问题,但这不是永久的解决方案.这个问题突然开始发生了.我们没有更改代码.

I can fix this issue by turning off Static compression in IIS but this can't be a permanent solution. The issue has suddenly started happening. We haven't changed the code.

Web 应用程序是 .net 4 中的 asp.net Web 表单应用程序.静态和动态压缩在 IIS 中设置.另一个 Web 表单 Web 应用程序在应用程序级别设置了静态压缩仍然运行良好.

The web application is an asp.net web forms app in .net 4. static and dynamic compression was set in IIS. another web forms web application is still running fine with static compression set at the application level.

服务器已更新为 .net 4.5 框架.

the server was updated to .net 4.5 framework.

一些样式表标签被设置为runat server,因为我附加了一个版本号以在缓存和发布新版本时强制重新加载css.

Some of the stylesheets tags are set to runat server as I append a version number to force a reload of the css when its cached and a new version is released.

此问题仅在 Internet Explorer 中发生.

This issue only happens in Internet Explorer.

我真的被这个问题困住了.

I am really stuck on this issue.

请求

Request GET        /webapp/JavaScript/jQuery/js/jquery-1.3.2.min.js HTTP/1.1
Accept  text/html, application/xhtml+xml, */*
Accept-Language x-en-GB-zscot
User-Agent  Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
UA-CPU  AMD64
Accept-Encoding gzip, deflate
Host    localhost
Connection  Keep-Alive

响应标头

Key Value
Response    HTTP/1.1 200 OK
Cache-Control   private
Content-Type    application/x-javascript
Content-Encoding    gzip,gzip
Last-Modified   Wed, 10 Oct 2012 15:45:44 GMT
Accept-Ranges   bytes
ETag    "04f24efea6cd1:0"
Vary    Accept-Encoding
Server  Microsoft-IIS/7.5
X-Compressed-By HttpCompress
Date    Tue, 04 Dec 2012 11:07:13 GMT
Content-Length  19788

响应正文的一部分

‹
@õ¿‹ä½kwÚȶ(úýü
¬ÕÛ-…âá¤×>g +ŒtÂÛI~a²®²M7F^€ã¤ýÛï|T•ª„p²ö8çŽ;ÆéÑ1R©Þ5k¾kVéÕÿȽÊýñé)šÏµÃ¯áéh>yæº"›yI_ŠoŠ¯1Ïýrùè—Jü³GñC  RñÃûøñû|rw¿Ì¹#/÷ºþG®ßÏrŸ£Åä3|x

推荐答案

我已使用 Blowery HttpCompression 将此问题缩小到网站.

I have narrowed this issue down to the web site using Blowery HttpCompression.

似乎 .net 4.5 Blowery 和 IIS 不再能很好地协同工作,静态内容似乎被压缩了两次,一次由 Blowery 压缩,一次由 IIS 压缩.

It seems that with .net 4.5 Blowery and IIS no longer play together nicely and the static content seems to be compressed twice, once by Blowery and once by IIS.

以上是一个猜测,但我认为我知道的是,删除 Blowery 后网站会再次正常工作.

The above is a guess but one think I do know is that be removing Blowery the website works fine again.

这篇关于IE 在 IIS7 中加扰脚本并打开静态压缩的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
how do i pass parameters to aspnet reportviewer(如何将参数传递给aspnet report查看器)
Bind multiple parameters from route and body to a model in ASP.NET Core(在ASP.NET Core中将路由和主体中的多个参数绑定到一个模型)
Custom model binding in AspNet Core WebApi?(AspNet Core WebApi中的自定义模型绑定?)
How to minify in .net core mvc view?(如何在.Net核心MVC视图中缩小?)