WCF DataPortal Compression

WCF DataPortal Compression

Old forum URL: forums.lhotka.net/forums/t/5992.aspx


ixman posted on Sunday, December 14, 2008

Hi,

Did anyone tried to do compression for WCF dataportal? Is there a best practice on how to do compression on the dataportal?

Thanks,

sergeyb replied on Sunday, December 14, 2008

I have written a simple compression routine for basicHTTPBinding for  WFC portal.  It does shrink messages to 80% size, although it does result in higher CPU utilization on both client and server.  It is implemented as WCF behavior extension, so it results in no code changes in CSLA or an application based on CSLA and is configured entirely in web.config.  Then again, I do not know if this is a best practice or now, but I was not even remotely happy with message sizes.  A simple ROLB object with 2000 rows 3 columns each resulted in 8.5 MB message using bacisHTTPBinding.  With compression size went down to about 450KB.  I estimated the actual data size at around 250KB or so.

 

 

 

Sergey Barskiy

Principal Consultant

office: 678.405.0687 | mobile: 404.388.1899

cid:_2_0648EA840648E85C001BBCB886257279
Microsoft Worldwide Partner of the Year | Custom Development Solutions, Technical Innovation

 

From: ixman [mailto:cslanet@lhotka.net]
Sent: Sunday, December 14, 2008 2:33 PM
To: Sergey Barskiy
Subject: [CSLA .NET] WCF DataPotal Compression

 

Hi,

Did anyone tried to do compression for WCF dataportal? Is there a best practice on how to do compression on the dataportal?

Thanks,



ixman replied on Monday, December 15, 2008

Hi,

Thanks for the reply... In my case is even worse, I have to use WSHttpBinding because of security requirements and my ROLB is almost double in size. Is it possible to post some code of how you did the compression?

Thanks,

ixman replied on Monday, December 15, 2008

Hi,

I've found an example on the Windows SDK and I'll go on that direction...

Thanks,

sergeyb replied on Monday, December 15, 2008

Here is the link to a blog entry I wrote on the subject:

 

http://sergeybarskiy.spaces.live.com/blog/cns!2383900F69B808E0!188.entry

 

 

If you google BehaviorExtensionElement and IServiceBehavior you will find sample code for the actual class.  Let me know if you have troubles finding the implementation, and I will try to dig up the actual code.  I just used .NET compression classes (Deflate or GZip) to compress incoming / outgoing messages.

 

Sergey Barskiy

Principal Consultant

office: 678.405.0687 | mobile: 404.388.1899

Magenic ®

Microsoft Worldwide Partner of the Year | Custom Development Solutions, Technical Innovation

 

From: ixman [mailto:cslanet@lhotka.net]
Sent: Monday, December 15, 2008 2:08 AM
To: Sergey Barskiy
Subject: Re: [CSLA .NET] RE: WCF DataPotal Compression

 

Hi,

Thanks for the reply... In my case is even worse, I have to use WSHttpBinding because of security requirements and my ROLB is almost double in size. Is it possible to post some code of how you did the compression?

Thanks,



Paul Czywczynski replied on Monday, December 15, 2008

You can see a previous thread about it with files.

  http://forums.lhotka.net/forums/thread/22070.aspx

-Paul

Copyright (c) Marimer LLC