locked
ISAPI Extension to adjust HTML in Response File before going to Browser RRS feed

  • Question

  • User-1750170122 posted

    Our project would like to intercept the HTML generated by an application and modify the HTML to incorporate changes (fairly straightforward find/replace) for performance.  The application is an intranet application and runs on IIS 6.0 with a max of 300 concurrent users.  We would like to avoid touching the application, but do want to adjust the HTML before the response reaches the client's browser. 

    We only want to adjust the HTML file under 1 specific aspx.

    Is developing an ISAPI Extension the right way to go?

    We have also looked into a Proxy approach to catch the response and apply the find/replace, but can't seem to get the Proxy to work. 

    Looking for any examples of ISAPI Extensions or Wildcard Extensions that other people may have developed that can help us with our work.

    Thanks for your time.  

     

     

    Monday, March 24, 2008 7:17 PM

Answers

  • User-1853252149 posted

    Might look at ISAPIRewrite and see if it can already do what you ask.  Otherwise, if you don't want to edit the ASPX file, you'll need to do an ISAPI filter to handle this.

    Jeff

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Tuesday, March 25, 2008 10:32 AM

All replies

  • User-1853252149 posted

    Might look at ISAPIRewrite and see if it can already do what you ask.  Otherwise, if you don't want to edit the ASPX file, you'll need to do an ISAPI filter to handle this.

    Jeff

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Tuesday, March 25, 2008 10:32 AM
  • User-1750170122 posted

    We looked into ISAPIRewrite, but it looked like it would only edit the URL.  We are actually trying to perform a find/replace within the HTTP Response containing the HTML. 

    The current HTML renders in 5 minutes on a client PC due to many factors , but one key item is the 1 CSS file being repeated 560+ times and 45KB size and also contained throughout the HTML.  Our find/replace will improve the HTML with some easy adjustments and improve the rendering time significantly.

    We are looking at a Proxy that can perform this kind of work or a HTTP Module (invoked at the End Request event) or an ISAPI Extension to perform the Find/Replace. 

    We are looking for advice from people that may have performed the same type of HTTP Find/replace function in the past. 

    Thursday, March 27, 2008 8:02 AM
  • User742541801 posted

    If it is just one specific URL, and an ASPX file, then I would recommend using an HttpModule, coded in C#.

    It's simple, easy to use, accessible for C# developers. An Isapi extension is unmanaged code, written in C, which maybe is accessible to you, but, it is messier than the HttpModule mechanism.  And, if you are only doing a single URL, and it is ASPX, then you are already in the managed code realm. 

    On the other hand it may be better to re-architect the app to remove the 560 CSS inline inclusions.  Zowie.

     

    Tuesday, April 15, 2008 12:40 PM