views:

240

answers:

2

Hello everyone,

I'm debugging an HttpModule with an ASP.NET response filter. This dynamically rewrites portions of rendered SharePoint WCM pages. The publishing pages render fine in SP2007 on both Server 2003 and Server 2008. However the equivalent pages fail to render in SP2010 B2 on Server 2008 R2 / IIS7. The following error is returned by ASP.NET:

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.

This error is consistent with KB #2014472. However:

  1. Caching is disabled for anonymous & authenticated access at the site collection level
  2. There do not appear to be any Substitution controls on either the master or layout page
  3. The IIS 7 settings are all stock default

This is happening e.g. on /pages/default.aspx. It seems likely I'm missing something cache related...but what?

A: 

UPDATE

Here's an official "answer" from MS Dev Support on this issue.

Question:
What is the alternative to response filtering in ASP.NET for modifying HTML rendered by another process when:
1. The other process cannot be modified
2. Post-cache substitution must be supported

Answer:
"Yes, you question is clear as blue sky and this is officially claimed to be not support. As Post-cache substitution would combine certain substitution chunks to the response bytes while response filtering expects to filter the raw bytes of the response(not modified). So the previously combined substitution chunks cannot be preserved anymore.

There is not an alternative from Microsoft so far."

Jason Weber
A: 

Hi Jason,

Maybe you've found a suitable solution by now, but I stumbled across this very same issue.

I was able to resolve it by opening the site's "Pages and Controls" in IIS 7 and set the Buffer option to False.

Ruud Stijger
Thank you for this reply. This does solve the problem in the sense that the page will successfully render. However, turning off output caching can impact scalability in a big way. As such, this might be ok for smaller sites but may be unacceptable for larger ones.
Jason Weber