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

httpcomression

3 Answers 87 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
ehsan
Top achievements
Rank 1
ehsan asked on 02 Nov 2008, 10:23 AM
hi all,
i added this code too my project global.asax

HttpApplication app = (HttpApplication)sender;
        string acceptEncoding = app.Request.Headers["Accept-Encoding"];
        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");


but my rad controls not shown correctly,
how i can correct it?



3 Answers, 1 is accepted

Sort by
0
Erjan Gavalji
Telerik team
answered on 02 Nov 2008, 03:24 PM
Hi,

If you use RadScriptManager or RadStyleSheetManager, you should either
  • set their OutputCompression property to false when using custom compression
  • exclude the Telerik.Web.UI.WebResource.axd from the custom compression.
The problem happens, because the JavaScript/CSS resources get compressed twice.

Kind regards,
Erjan Gavalji
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Grzesiek
Top achievements
Rank 2
Iron
answered on 30 Sep 2009, 10:31 AM
Hello!

I have the same problem with compression.

How and where I can exclude the Telerik.Web.UI.WebResource.axd from the custom compression?

Thanks.
0
Erjan Gavalji
Telerik team
answered on 30 Sep 2009, 12:48 PM
Hi Grzesiek,

It depends on the code you have for the custom compression. Basically you could identify if the request is made to the Telerik.Web.UI.WebResource.axd handler and leave its output intact...

Best regards,
Erjan Gavalji
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
General Discussions
Asked by
ehsan
Top achievements
Rank 1
Answers by
Erjan Gavalji
Telerik team
Grzesiek
Top achievements
Rank 2
Iron
Share this question
or