Для начала вам нужно создать HttpHandler для его обработки:
namespace com.waynehartman.util.web.handlers
{
[WebService(Namespace = "http://waynehartman.com/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class HttpCompressor : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
// Code for compressing the file and writing it to the HttpResponse
}
public bool IsReusable
{
get { return true; }
}
}
}
Затем вам нужно добавить отображение обработчика в ваш web.config:
<configuration>
<system.web>
<httpHandlers>
<add verb="*" path="*.css"
type="com.waynehartman.util.web.handlers.HttpCompressor, WayneHartmanUtilitiesLibrary"/>
<add verb="*" path="*.js"
type="com.waynehartman.util.web.handlers.HttpCompressor, WayneHartmanUtilitiesLibrary"/>
</httpHandlers>
</system.web>
</configuration>