Easy to Implement NPH

NPH, Non-Parsed Header Output, means that the output of web application is sent directly to the browser, with minimal internal and no transport-visible buffering by the Web server. The web application using the NPH output method must return a complete HTTP response message in the appropriate format according to the server's HTTP version.

You can request NPH output by putting nph- just before the filename of the web application. For example, if the normal URL is

then the NPH request is

This implies that you need to compile the web application into nph-demo.exe. Also you need to modify the <FORM ACTION="demo.exe" METHOD=...> to <FORM ACTION="nph-demo.exe" METHOD=...>. In addition to this, you also need to write code to handle HTTP response message according to web server's HTTP version. This requires the programmer to know HTTP protocol very well. It makes a big learning curve for programmer to use NPH.

WebRainbow makes NPH easy. It has NPH mechanism to generate appropriate HTTP response message. As a programmer, you only need to write code same as used for normal request method, put nph- before the filename you want to access, and compile the code to nph-filename.exe. If you separate <FORM ACTION=...> to the static portion using WebRainbow's static / dynamic separation method described in the Only FORM Merged In section, the web application, which was used for normal request method, does not need to be recompiled, just rename it with nph- appearing before the previous filename, and change <FORM ACTION="..."> in the HTML file which is static portion of the page.

For the demo purpose, we use the previous example, which is discussed in Only FORM Merged In section, to show how easy to make it suitable for NPH. Only three static section files, two containing <FORM ACTION="...">, one containing <A HREF="HtmlSection.exe?request=..."> need to be modified. No any changes are made to the other files, including Visual Basic code. Here are these three modified files:

  1. HtmSecF1.html (<FORM ACTION=...> has been modified)
  2. HtmSecL.html (<FORM ACTION=...> has been modified)
  3. HtmSec2.html (<A HREF="HtmlSection.exe?request=..."> has been modified)

In these three files, the only change is that HtmlSection.exe is replaced by nph-HtmlSection.exe.

After we rename web application HtmlSection.exe to nph-HtmlSection.exe, we can type http://your_site/scripts/nph-HtmlSection.exe to retrieve page in NPH mode.

Click following link to

Good luck!


For the latest information on WebRainbow, please see:
http://www.dmfsys.com/wrainbow/

For questions / comments please email to:
support@dmfsys.com


Copyright © 2000 - 2005 D.M.F. Systems, Corporation. All rights reserved.

Last modified on March 2, 2005