I creat a project and using gzip in Global.asax :
protected void Application_BeginRequest(object sender, EventArgs e)
{
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 System.IO.Compression.GZipStream(prevUncompressedStream,
System.IO.Compression.CompressionMode.Compress);
app.Response.AppendHeader("Content-Encoding",
"gzip");
}
else if (acceptEncoding.Contains("deflate"))
{
// defalte
app.Response.Filter = new System.IO.Compression.DeflateStream(prevUncompressedStream,
System.IO.Compression.CompressionMode.Compress);
app.Response.AppendHeader("Content-Encoding",
"deflate");
}
}
But I use control of Telerik then style error. It doen't display. Can I help me fix.Thanks all
Project address : <the link was removed because the project contains a registered Telerik.Web.UI.dll, which violates the license agreement - please remove the dll or the whole project from the shared location>
My email :vthoangtnt@gmail.com
protected void Application_BeginRequest(object sender, EventArgs e)
{
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 System.IO.Compression.GZipStream(prevUncompressedStream,
System.IO.Compression.CompressionMode.Compress);
app.Response.AppendHeader("Content-Encoding",
"gzip");
}
else if (acceptEncoding.Contains("deflate"))
{
// defalte
app.Response.Filter = new System.IO.Compression.DeflateStream(prevUncompressedStream,
System.IO.Compression.CompressionMode.Compress);
app.Response.AppendHeader("Content-Encoding",
"deflate");
}
}
But I use control of Telerik then style error. It doen't display. Can I help me fix.Thanks all
Project address : <the link was removed because the project contains a registered Telerik.Web.UI.dll, which violates the license agreement - please remove the dll or the whole project from the shared location>
My email :vthoangtnt@gmail.com