ASP.NET MVC Response Filter + OutputCache Attribute

前端 未结 2 1438
自闭症患者
自闭症患者 2021-01-13 04:45

I\'m not sure if this is an ASP.NET MVC specific thing or ASP.NET in general but here\'s what\'s happening. I have an action filter that removes whitespace by the use of a r

2条回答
  •  无人及你
    2021-01-13 05:40

    This KB article may offer some insight into the root cause of this issue. While the filter 'breaks' caching in IIS6 it throws an error in IIS 7. This seems to be a design / test-time improvement at best.

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

提交回复
热议问题