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

Thread is closed for posting
1 posts, 1 answers
  1. Answer
    Telerik Admin
    Telerik Admin avatar
    1679 posts
    Member since:
    Oct 2004

    Posted 23 Oct 2009 Link to this post

    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.3.1118 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["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("User-Agent") = True
    End Sub

    UPDATE (11/18/2009): The Accept-Encoding header has been removed from the VaryByHeaders property as this is preventing Internet Explorer 6 from caching the response.

Back to Top