Home / Community & Support / Knowledge Base / RadControls for ASP.NET and ASP.NET AJAX / General, Installation, Licensing / The Telerik.Web.UI.WebResource.axd handler can return uncompressed content for browsers that accept gzip encoding and vice versa.

The Telerik.Web.UI.WebResource.axd handler can return uncompressed content for browsers that accept gzip encoding and vice versa.

Article Info

Rating: Not rated

Article information

Article relates to

 RadScriptManager

Created by

 Tsvetomir, Telerik

Last modified

 October 23, 2009    

Last modified by

 Peter, Telerik


PROBLEM

The Telerik.Web.UI.WebResource.axd handler can return uncompressed content for browsers that accept gzip encoding and vice versa.

SOLUTION

Either upgrade your Telerik.Web.UI assembly to version 2009.2.1022 or higher.

Or, add this code to your Global.asax file:

C#
protected void Application_PostRequestHandlerExecute(object sender, EventArgs e)
    {
        HttpApplication app = (HttpApplication)sender;
  
        if (!app.Request.RawUrl.Contains("Telerik.Web.UI.WebResource.axd"))
            return;
  
        HttpCachePolicy cachePolicy = app.Response.Cache;
        cachePolicy.VaryByHeaders["Accept-Encoding"] = true;
        cachePolicy.VaryByHeaders["User-Agent"] = true;    
    }

VB.NET
Protected Sub Application_PostRequestHandlerExecute(sender As Object, e As EventArgs)
    Dim app As HttpApplication = DirectCast(sender, HttpApplication)
  
    If Not app.Request.RawUrl.Contains("Telerik.Web.UI.WebResource.axd") Then
        Return
    End If
  
    Dim cachePolicy As HttpCachePolicy = app.Response.Cache
    cachePolicy.VaryByHeaders("Accept-Encoding") = True
    cachePolicy.VaryByHeaders("User-Agent") = True
End Sub

Comments

There are no comments yet.
If you'd like to comment on this KB article, please, send us a Support Ticket.
Thank you!

Please Sign In to rate this article.