Your data. Anywhere you go.

New Relic for iOS or Android

Download on the App Store    Android App on Google play

New Relic Insights App for iOS

Download on the App Store

Learn more

Close icon

Post cache substitution is not compatible



After installation one of the site on our server started to report following error:

Exception information:
    Exception type: System.InvalidOperationException
    Exception message: 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.

Application pool is configured as .NET v.4.0, Integrated.
After changing to Classic pipeline mode, error was gone, but ImageResizer module which we are using stopped to work.


This error message relates to our browser monitoring javascript. Our .Net agent is attempting to use ASP.NET Request Filtering to inject our javascript into your pages as part of the browser monitoring auto-instrumentation process.

The ASP.NET Request Filtering is incompatible with the post cache substitution being use by your app. It also sounds as if post cache substitution is required for your ImageResizer module, which is one possible reason it no longer works when you switch to classic pipeline mode.

If you visit the “Troubleshooting” section of our docs page on Page load timing in .NET (there is a broken quick link on that page and I have a bug ticket in to fix that), we have the following information:

If you receive an InvalidOperationException that states “Post cache substitution is not compatible with modules in the IIS integrated pipeline that modify the response buffers,” then you must manually instrument page load timing (sometimes referred to as real user monitoring or RUM) rather than using the auto-instrumentation. In this case, set browserMonitoring to “false” in the newrelic.config file found in the New Relic .NET Agent installation directory, and follow the instructions above for Manual Instrumentation.

Two possible approaches are, 1) disable browser monitoring completely or 2) use manual instrumentation to insert the browser monitoring javascript into your pages. Both options should allow you to continue issuing your ImageResizer module without this error occurring. With option 2, you should get both a working ImageResizer module and browser performance data in our web dashboard for this app.