ASP.NET response filtering and post-cache substitution are not compatible

Article ID: 2014472 - View products that this article applies to.
Expand all | Collapse all


Consider the following scenario:

  1. You have an ASP.NET application running on Internet Information Services 6.0 or Internet Information Services 7.0. 
  2. The application uses post-cache substitution.
  3. The application also uses an HTTP filter module to filter out rendered content.


In this scenario, the following problems may occur:

  • If the application is hosted on IIS7 in Classic Pipeline mode, or on IIS6, the substitution blocks are only rendered on the first request. Subsequent page accesses cause the full page to be served from the output cache and the substitution blocks to not be updated.



  • If the application is hosted on IIS7 in Integrated Pipeline mode, an exception of type System.InvalidOperationException occurs with the following details:

Exception Details: System.InvalidOperationException: Post cache substitution is not compatible with modules in the IIS integrated pipeline that modify the response buffers.  Either a native module in the pipeline has modified an HTTP_DATA_CHUNK structure associated with a managed post cache substitution callback, or a managed filter has modified the response.



Response filtering and post-cache substitution are not compatible.



To avoid the problem, choose one of the following options:

  1. Disable output caching on pages that are using substitution blocks.


  2. Do not use the response filter module.

More Information

Post-cache substitution is implemented using a list of substitution blocks (.NET delegates) used to reconstruct individual pieces of the response. ASP.NET internally maintains a list of HTTP_DATA_CHUNK structures associated with a managed post-cache substitution callback.  When a response filter is used, a raw response is rendered into a single buffer and the list of substitution blocks is lost.  Therefore, the substitution blocks cannot be rendered.

For more information on post-cache substitution, please see:


Caching Portions of an ASP.NET Page


Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use for other considerations.


Article ID: 2014472 - Last Review: January 19, 2010 - Revision: 2.0
  • Microsoft ASP.NET 2.0, when used with:
    • Microsoft Internet Information Services 6.0
    • Microsoft Internet Information Services 7.0

Give Feedback


Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from