ASP.NET MVC Response Filter + OutputCache Attribute

I'm not sure if this is the specific thing of ASP.NET MVC or ASP.NET in general, but here's what happens. I have an action filter that removes spaces using the response filter:

public class StripWhitespaceAttribute : ActionFilterAttribute
{
    public StripWhitespaceAttribute ()
    {

    }

    public override void OnResultExecuted(ResultExecutedContext filterContext)
    {
        base.OnResultExecuted(filterContext);

        filterContext.HttpContext.Response.Filter = new WhitespaceFilter(filterContext.HttpContext.Response.Filter);
    }
}

When used in conjunction with the OutputCache attribute, my Response.WriteSubstitution calls to "cache holes in the donut" do not work. The first and second time the page loads the callback passed to WriteSubstitution, it is called, after which they are no longer called until the expiration of the output cache. I noticed this, not only with this particular filter, but with any filter used in Response.Filter ... did I miss something?

, MVC, PostReleaseRequestState global.asax Response.Filter... .

+4
2

KB . "" IIS6, IIS 7. /.

UPDATE

MS Dev Support .

:
ASP.NET HTML, , :
1.
2.

:
" , , , , . Post-cache , ( ) , .

Microsoft .

+3

AFAIK, , , . AuthorizeAttribute , API . , , .

, . , , .

, , , , WriteSubstitution, . HttpResponse, , , . , HttpWriter.

, " ASP.NET MVC Framework" ( , ). 10 , MVC . outputcache ... , - .

+2

All Articles