I would like to capture HTML before its gets sent to the browser for caching. Is there a way to do this?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’ve never tried this, but could you hook into the EndRequest event of an HTTP module, and simply read the Response property?
Edit: Just tried this – massive fail, at least at a simple level, because the Response isn’t readable at that point. Could still be viable if there’s a way to redirect the output of the Response at the beginning of a request, and then pipe it through at the end.
Edit #2: I was close, but it’s more complex than I thought. You need to implement a filter, which is demonstrated nicely here.