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

Symptoms

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.

 

OR


  • 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.

 

Cause

Response filtering and post-cache substitution are not compatible.

 

Resolution

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

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

    OR

  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
http://msdn.microsoft.com/en-us/library/h30h475z.aspx

 

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.

Properties

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

Give Feedback

 

Contact us for more help

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