This is a migrated thread and some comments may be shown as answers.

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

0 Answers 254 Views
ScriptManager and StyleSheetManager
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Telerik Admin
Top achievements
Rank 1
Iron
Telerik Admin asked on 23 Oct 2009, 10:24 AM
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.

Tags
ScriptManager and StyleSheetManager
Asked by
Telerik Admin
Top achievements
Rank 1
Iron
Share this question
or