IHttpHandler and IHttpHandlerFactory

IHttpHandler interface is implemented by all the handlers. The interface consists of one property called IsReusable. The IsReusable property gets a value indicating whether another request can use the IHttpHandler instance.  The method ProcessRequest() allows you to process the current request. This is the core place where all your code goes. 

IHttpHandlerFactory The IHttpHandlerFactory interface consists of two methods - GetHandler and ReleaseHandler. The GetHandler() method instantiates the required HTTP handler based on some condition (typically a file extension )and returns it back to ASP.NET. The ReleaseHandler() method allows the factory to reuse an existing handler.