RadCompression Module and RIA

Planet Software are long-time users of Telerik controls, and one of the nice modules they provide is called RadCompression.

This module is an HttpModue that automatically compresses AJAX and Web Service responses, and this includes WCF and RIA.

The beauty of it is no developer effort is required: an administrator can define the use in an applications web.config as shown below:

C#
<httpModules>
  ...
  <!-- Add this line exactly as is - the name value is important -->
  <add name="RadCompression" type="Telerik.Web.UI.RadCompression" />
</httpModules>
<!-- If you're using IIS7, then add this, too-->
<system.webServer>
  <modules>
    ...
    <add name="RadCompression" type="Telerik.Web.UI.RadCompression" />
  </modules>
  ...

The benefits should be obvious, but take a look at some of the following links that elaborate and provide metrics to wet your appetite:

However, one gotcha I came across recently that I felt I should share to save others diagnostic time:

Empty Collections Result in Error on Client

I found with a Silverlight 4 project I have that when an empty collection is sent from the server to the client, if RadCompression is enabled then the client receives the LoadedDataEventArgs with its HasError set to true.  If you disable RadCompression, then no error flag is set.

However, this only appears to be when using the VS build-in web server; running on IIS7, etc. seems to work fine.

Telerik have investigated, and responded with “The root cause for this behavior seems to be some difference of WCF request handling. In the case in question ContentType is not correctly set to reflect the actual compressed length, resulting in wrong decompression and incorrect data deserialization.”.

So we can deal with this known issue by making use of a web.config transformation to only use RadCompression in the release/published build.

Telerik advise that they “will continue to investigate the matter and research for a possible workaround”.

Print | posted on Friday, 25 June 2010 1:10 PM

Feedback

No comments posted yet.
Title  
Name
Email (never displayed)
Url
Comments   
Please add 8 and 4 and type the answer here: