MVC5 js捆绑gzip无法正常工作

时间:2015-01-11 05:51:14

标签: asp.net-mvc iis gzip

我已经在google上阅读了有关此内容的每篇文章,但我似乎无法弄清楚为什么捆绑生成的.js文件包似乎无法获得gzip的爱。 我甚至将以下内容添加到我的web.config

 <system.webServer>
<staticContent>
  <remove fileExtension=".js" />
  <mimeMap fileExtension=".js" mimeType="text/javascript" />
</staticContent>
<urlCompression doStaticCompression="true" doDynamicCompression="true" />

我认为这不起作用,因为捆绑者创建的内容不存在genreated mimeType。这里是没有类型生成的捆绑之一。我不确定IIS 8默认是否将其视为text / javascript

   <script src="/bundles/modernizr?v=wBEWDufH_8Md-Pbioxomt90vm6tJN2Pyy9u9zHtWsPo1"></script>
   <script src="/bundles/jquery?v=FVs3ACwOLIVInrAl5sdzR2jrCDmVOWFbZMY6g6Q0ulE1"></script>

gzip似乎适用于网站上的其他所有内容,除了.js文件

在Windows 2012包装盒上运行

0 个答案:

没有答案