.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

WCF net.tcp VS. Compression

Posted By:      Posted Date: October 11, 2010    Points: 0   Category :WCF



What is the most efficient way to send data over the network (LAN), use binary encoder with net.tcp or do custom compression to the message.

is there a benfit from combined both way, using net.tcp encoding and doing compression on the message?


View Complete Post

More Related Resource Links

IIS 6.0 Gzip Compression and Sharepoint

  I have enabled GZIP compression on my WCM site per this article: http://blogs.technet.com/wbaer/archive/2008/01/30/http-compression-internet-information-services-6-0-and-sharepoint-products-and-technologies.aspx. This worked for .css and .js sitting in the 12 hive and I can see using fiddler that these files are being compressed.  However, .css and .js that are sitting in the content database are not compressed (e.g. within the Style Library).  Is this a known limitation, or is there a way I can get around this? My setup is Win2k3, IIS6, MOSS 2007 SP2, SQL 2005.  I have 1 SQL and 1 WFE server. -Ron  

System.IO.Compression not as good as compressed folder

I'm getting much better compression when I make a compressed folder (Windows XP) than I am using DeflateStream or GZipStream.  I thought these were the same algorithms used in PKZIP and for compressing folders.  Why such bad compression? DeflateStream: 3544Kb -> 1261Kb GZipStream: 3544Kb -> 1261Kb Windows XP: 3544Kb -> 804Kb So how can I get the same compression ratio as Windows XP? Thanks, Jeremy

Best Way to Enable HTTP Compression

I'm trying to improve the performance of my site using HTTP compression (GZIP or Default) but I'm having trouble finding the information I'm after.My requirements are that I can't use IIS direct (my site uses shared hosting) and I don't want to use a 3rd party tool (my understanding is that it's not necessary). I'd prefer a web.config solution, if there is one.I've been searching for a while. Most solutions I found are very old, some require direct access to IIS, and others require 3rd party tools. I found one that looked promising at http://www.stardeveloper.com/articles/display.html?article=2007110401&page=1, but while it worked under Visual Studio it complains about app.Context.CurrentHandler being null when deployed on my site.As I understand it, there's very little reason not to use compression but I'm having trouble finding current information.Anyone else having better luck with this?Thanks.

HTTP Handler IIS Compression

I am using a IHttpHandler to write a PDF file to the output stream in IIS 7 with ASP.NET 4 RC as follows.context.Response.WriteFile(pdfFilePath) context.Response.Flush() I am aware that IIS 7 offers both static and dynamic compression which is configured using the urlCompression and httpCompression elements in their respective config files. This works well except for with the output of IHttpHandlers. It seems their output is not being compressed even though I have enabled dynamic compression and added the IHttpHandler's mime-types (application/pdf in this case) to the dynamicTypes section.Why are my IHttpHandler's output not being compressed by IIS? I'm aware I could do this manually in the handler but I'd rather let IIS do it.Thanks,Eric

Resized image compression difference



I'm developing an image storage service and for that purpose, I'm resizing the uploaded images in order to get thumbnail and tiny-sized versions of the source image. This works just fine. However when looking into the actual files, I realized that the resized images "weight" actually more on the disk than the source. Here's an example:

- Source image, 1024x768, JPEG, 94.17 KB
- Medium sized image, resized by my code: 500x375, JPEG, 465.47 KB
- Small sized image, resized by my code: 150x112, JPEG, 47.05 KB 

Something is clearly wrong here. The medium sized image is twice smaller in resolution, but weights more than 4 times than the source image.

Here's an excerpt of the code that actually resizes images:

private void ResizeImage(string originalFile, string NewFile, int NewWidth, int MaxHeight, bool OnlyResizeIfWider, string directory)
            System.Drawing.Image FullsizeImage = System.Drawing.Image.FromFile(originalFile);

            // Prevent using images internal thumbnail

            if (OnlyResizeIfWider)
                if (FullsizeImage.Width <= Ne

Resizing Images using GetThumbnailImage, Bad Compression Rate



 I am using the following code to resize an image from original size


    protected void resizeImage(String fileName, String imagePath, int resizeWidth, int resizeHeight)
        // Load Original Image
        System.Drawing.Image originalImage;
        originalImage = System.Drawing.Image.FromFile(strImageFolder + "original\\" + fileName);

        // Get Original Image Dimensions
        int originalHeight = originalImage.Height;
        int originalWidth = originalImage.Width;

        // Set new Image dimensions
        int newWidth = resizeWidth;
        int newHeight = (newWidth * originalHeight) / originalWidth;

        // Creates new resized image
        System.Drawing.Image resizedImage;
        resizedImage = originalImage.GetThumbnailImage(newWidth, newHeight, new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback), IntPtr.Zero);
        resizedImage.Save(imagePath + fileName);
Now th

System.IO.Compression from Device to Database to Service



I have a Windows Mobile Forms application that uses the System.IO.Compression DeflateStream class to Compress a bitmap image of a signature, which it does well compressing from ~86kB to ~6kB.

Once compressed, the byte array is written to a SQL CE Database (into an Image datatype column), which is later transferred to a staging database via MS Sync Framework.

Once in the staging database, I have a Windows Service which will read the signature data, decompress it and turn it back into a bitmap.

Unfortunately, when I try to decompress the byte array, I get the following exception "Index was outside the bounds of the array.".

Before I introduced Compression, this system worked 100%.

Now, I've tested in the Client (Windows Mobile) application that I can compress the Image to a byte array, then decompress the byte array back to an image and that works. Also, I have the same Compress/Decompress helper methods in the Client and Server applications.

I'm wondering where the problem lies; Is there a difference between the Compact Framework 3.5 and .NET Framework 3.5 implementations of DeflateStream that renders them incompatible? Or is there some issue with writing a compressed Byte Array to an Image column in a table and reading it back?

Here is the code for my Compress/Decompress helper methods:

SharePoint 2010 Document Compression


Dear Sir , 

I have SharePoint 2010 , I made SharePoint Document Library And I Want To known That SharePoint Server 2010 Compress Document Size Or Not i.e, if i have a huge document size SharePoint compress it's size or not??

Query string compression


I'm working on an android application that will collect information from my mySQL database. For obvious security reasons I can't connect to the database with the application so instead I'm using an XML page to gather the information.

The problem is the search filters and having to pass potentially a lot of information through a query string. I found out a pretty ingenious method to significant shrink the size of the query string, but my question is, is this method too expensive?


Each item on the database has a primary key which starts at 1 and so on. Well using math if you take each number to the power of 2 you can simply add them up together to compress the values.

Example: You want to reference IDs 2,3,5,7,8. Instead of sending the query string: ?keys=2,3,5,7,8 you take each number and take it to the power of 2 and add them.

2^2+2^3+2^5+2^7+8^2 = 428

The issue is having to decode the information on the server through a while loop.

Dim i as Integer = 428 'Total of 2^2+2^3+2^5+2^7+8^2
Dim x = 8 'Highest key in database in example
Dim queueList As New Queue

Compression in merge replication



We are using SQL 2008 Standard Edition. I am thinking to leverage merge replication between two databases connected through VPN.

Is it possible to compress the data exchange package that the merge replication passes through network?

Thank you.

Has Anyone Got HTTP Compression Working?


I've spent quite a bit of time on this but seem to be going nowhere. I have a large page that I really want to speed up. The obvious place to start seems to be HTTP compression, but I just can't seem to get it to work for me.

After considerable searching, I've tried several variations of the code below. It kind of works, but after refreshing the browser, the results seem to fall apart. They were turning to garbage when the page used caching. If I turn off caching, then the page seems right but I lose my CSS formatting (from a separate file) and get an error that an included JS file contains invalid characters.

Most of the resources I've found on the Web were either very old or focused on accessing IIS directly. My page is running on a shared hosting account and I do not have direct access to IIS7, which it's running on.

protected void Application_BeginRequest(object sender, EventArgs e)
    // Implement HTTP compression
    if (Request["HTTP_X_MICROSOFTAJAX"] == null)    // Avoid compressing AJAX calls
        // Retrieve accepted encodings
        string encodings = Request.Headers.Get("Accept-Encoding");
        if (encodings != null)
            // Check the b

problem with compression sink



We have a legacy winforms app that uses remoting, compression sink and NZipLib.  I've compiled/deployed the bin/web.config for the remoting piece to the server. I'm completely new to dot net remoting although I've tried to read as much as I can find.  When I debug the winforms app, I get an exception when I get to this line.  When I run the application, I can see that it's using the remote database, but I can't tell if it's going through the remoting piece or not, especially with this exception.  Any help is greatly appreciated.



.Configure(strFileName, True)    The strFileName points to the exe.config

The exception received is:

Remoting configuration failed with the exception 'System.IO.FileNotFoundException: Could not load f

FAQ: Does .NET have any compression/zipping capabilities?


Does .NET have any compression/zipping capabilities?

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.

data compression in sql server 2008, 2012

Data compression in sql server is a technique to reduce the size of the data stored in the table. It follows with two different method of compression. There are some advantages and disadvantages of compression also available. Please look through this post to understand the data compression in sql server in detail.

data compression in sql server 2008, 2012

Data compression in sql server is a technique to reduce the size of the data stored in the table. It follows with two different method of compression. There are some advantages and disadvantages of compression also available. Please look through this post to understand the data compression in sql server in detail.

sql server data compression advantages and disadvantages

data compression in sql server has its own advantages and disadvantages. This article helps to understand the advantages and disadvantages in detail.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend