Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.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
IIS在运行时进程的哪个点压缩输出?_Iis_Compression_Action Filter - Fatal编程技术网

IIS在运行时进程的哪个点压缩输出?

IIS在运行时进程的哪个点压缩输出?,iis,compression,action-filter,Iis,Compression,Action Filter,我最近尝试将一个运行时html缩略库集成到我的站点(C#、IIS8、MVC4)中。我们启用了IIS压缩。我发现IIS实际上压缩了action filter输出流,这意味着当我试图在action filter中缩小html时,我正试图缩小已经压缩的内容 问题:IIS在运行时进程的哪个点压缩输出?有没有办法在不禁用IIS压缩的情况下使用mvc操作筛选器修改html输出?ASP mvc输出的IIS动态压缩在管道中运行得很晚。在我的测试中,它是349个管道项目中的第315个,在所有asp.net模块运行

我最近尝试将一个运行时html缩略库集成到我的站点(C#、IIS8、MVC4)中。我们启用了IIS压缩。我发现IIS实际上压缩了action filter输出流,这意味着当我试图在action filter中缩小html时,我正试图缩小已经压缩的内容


问题:IIS在运行时进程的哪个点压缩输出?有没有办法在不禁用IIS压缩的情况下使用mvc操作筛选器修改html输出?

ASP mvc输出的IIS动态压缩在管道中运行得很晚。在我的测试中,它是349个管道项目中的第315个,在所有asp.net模块运行之后

要查看IIS管道中已执行模块的顺序,请为站点设置失败请求跟踪(FREB)并查看日志

我想说的是,在MVC操作过滤器中,没有办法告诉压缩模块不要压缩

但您可以基于url关闭压缩:

在您的web配置中,使用如下内容:

<location path="my/long/route/">
    <system.webServer>
      <urlCompression doDynamicCompression="false" />
    </system.webServer> 
</location>


您正在告诉IIS仅关闭该URL的动态压缩。

ASP MVC输出的IIS动态压缩在管道中运行得很晚。在我的测试中,它是349个管道项目中的第315个,在所有asp.net模块运行之后

要查看IIS管道中已执行模块的顺序,请为站点设置失败请求跟踪(FREB)并查看日志

我想说的是,在MVC操作过滤器中,没有办法告诉压缩模块不要压缩

但您可以基于url关闭压缩:

在您的web配置中,使用如下内容:

<location path="my/long/route/">
    <system.webServer>
      <urlCompression doDynamicCompression="false" />
    </system.webServer> 
</location>


您正在告诉IIS仅关闭该URL的动态压缩。

必须为
dynamicCompressionBeforeCache
属性指定一个值,该值等于
false

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  …
  <system.webServer>
    …
    <httpCompression …>
      …
    </httpCompression>
    <urlCompression … dynamicCompressionBeforeCache="false" />
    …
  </system.webServer>
  …
</configuration>

…
…
…
…
…

必须为
dynamicCompressionBeforeCache
属性指定一个值,该值等于
false

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  …
  <system.webServer>
    …
    <httpCompression …>
      …
    </httpCompression>
    <urlCompression … dynamicCompressionBeforeCache="false" />
    …
  </system.webServer>
  …
</configuration>

…
…
…
…
…

我知道这是一个老问题,但在使用StaticFiles之前使用UserResponseCompression时,错误已经解决

        app.UseResponseCompression();
        app.UseStaticFiles(new StaticFileOptions
        {
            ServeUnknownFileTypes = true,
            OnPrepareResponse = context => context.Context.Response.Headers.Add("Cache-Control", "public, max-age=2592000")
        });
        app.UseWebMarkupMin();

我知道这是一个老问题,但当我在使用静态文件之前使用UserResponseCompression时,错误得到了解决

        app.UseResponseCompression();
        app.UseStaticFiles(new StaticFileOptions
        {
            ServeUnknownFileTypes = true,
            OnPrepareResponse = context => context.Context.Response.Headers.Add("Cache-Control", "public, max-age=2592000")
        });
        app.UseWebMarkupMin();

你能解释一下为什么它应该是假的,或者它特定于WebMarkupMin吗?你能解释一下为什么它应该是假的,或者它特定于WebMarkupMin吗?