Thanks again !
But both URL using third party dll. The first one using "blowery" in which <httpCompress> is used, and second link uses "DC" control.
I haven't found any way to exclude "WebResource.axd" from web.config.
Is there any way that we can use HTTPCompression in ASP.NET.
Here is my code written on Global.asax:
void Application_BeginRequest(object sender, EventArgs e)
{
try
{
HttpApplication app = (HttpApplication)sender;
string acceptEncoding = app.Request.Headers["Accept-Encoding"];
System.IO.Stream prevUncompressedStream = app.Response.Filter;
if (acceptEncoding == null || acceptEncoding.Length == 0)
return;
acceptEncoding = acceptEncoding.ToLower();
if (acceptEncoding.Contains("gzip"))
{
// gzip
app.Response.Filter = new GZipStream(prevUncompressedStream, CompressionMode.Compress);
app.Response.AppendHeader("Content-Encoding",
"gzip");
}
else
if (acceptEncoding.Contains("deflate"))
{
// defalte
app.Response.Filter = new DeflateStream(prevUncompressedStream, CompressionMode.Compress);
app.Response.AppendHeader("Content-Encoding",
"deflate");
}
}
catch (Exception ex)
{
//Do Nothing .. on Exception
}
}
Thanks
Shikhar Dadhihc
www.shikhar.net