Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/441.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript asp.net中css和js的GZIP压缩_Javascript_Asp.net_Css_Compression_Gzip - Fatal编程技术网

Javascript asp.net中css和js的GZIP压缩

Javascript asp.net中css和js的GZIP压缩,javascript,asp.net,css,compression,gzip,Javascript,Asp.net,Css,Compression,Gzip,我已通过此链接: 但这对我没有帮助。 我甚至在web配置中编写了设置,但是css呢? 我如何压缩它? web配置中的我的代码: <httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files"> <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll"/> <dynamicTyp

我已通过此链接:

但这对我没有帮助。 我甚至在web配置中编写了设置,但是css呢? 我如何压缩它? web配置中的我的代码:

<httpCompression 
  directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
  <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll"/>

  <dynamicTypes>
    <add mimeType="text/*" enabled="true"/>
    <add mimeType="message/*" enabled="true"/>
    <add mimeType="application/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="*/*" enabled="false"/>
  </staticTypes>
</httpCompression>
<urlCompression doStaticCompression="true" doDynamicCompression="true"/>

我找到了同样的解决方案

IIS中还有一个用于启用静态和动态压缩的设置。 在IIS中安装动态压缩,这将起作用


另外,我清除了缓存并重新部署了应用程序,应用程序成功了。

为什么你知道/假设你的CSS没有被压缩传输?我一直在用YSLOW进行检测,它显示我需要压缩CSS。@ItiTyagi防火墙也会导致你的文件解压缩。@Shekar:我不明白这一点。我只需要知道我是否需要添加一些额外的CSS压缩代码?因为我已经压缩了javscript和aspx页面,所以我认为您不需要做任何其他事情。