ISAPI filters are DLLs that are loaded into the IIS process when the Web service is started, and stay in memory until the Web service shuts down. Once loaded, ISAPI filters can be configured to receive a number of special filter event notifications that occur with each HTTP request that IIS receives, and each response that IIS generates in return.
When an ISAPI filter is loaded, the filter passes a structure to IIS that contains, in addition to other information, a bit field that specifies for which types of filter event notifications the filter should be notified. Each time one of those events occurs, an event notification is sent, and every ISAPI filter that has specified interest in that event is notified.
The following diagram depicts the ISAPI filter architecture:
ISAPI filters are very powerful and can be used to facilitate applications that perform a number of different tasks, including:
The ability to examine, and if necessary modify, both incoming and outgoing streams of data makes ISAPI filters very powerful and flexible.
Important It is vital that the work performed by ISAPI filters is minimized, because the effects on scalability and performance is potentially quite severe. For example, if your ISAPI filter implemented your own custom encryption scheme, the encryption and decryption would need to take place within your ISAPI filter code, but the reading and writing of the data should be handled by IIS.
This section contains:
For more detailed reference information, see the ISAPI Filter Reference.