This project has moved and is read-only. For the latest updates, please go here.

GZip support

Feb 13, 2012 at 1:09 PM

Have you thought about integrating GZip support in AgFx? A fellow named Morten Nielsen has created a GzipWebClient that supports GZip compressed respones. It can be found here:


Feb 13, 2012 at 1:46 PM

+1 on GZip support. I saw the post from Jeff Wilcox on this ( and immediately thought about how it could be incorporated into AgFx. Unfortunately it was centred around a replacedment for WebClient and AgFx uses raw HttpRequest objects but maybe something might be done (might have to fork the original repo and create one that works with HttpRequest instead of WebClient).

Feb 13, 2012 at 6:00 PM

Hi - 

Actually this would be pretty easy to do.  If you look at the code for WebLoadRequest, it fully encapsulates the usage of HttpWebRequest.  Replumbing that to use WebClient instead would be very easy.  Then, in your DataLoaders you would just create a GzipWebLoadRequest instead of the regular WebLoadRequest.  

I'll have to look at what Martin did and what the licensing terms are.  I've written gzip support before (both client and server sides), and it's pretty simple, so supporting it directly in WebLoadRequest with HttpWebRequest is probably doable as well.

Maybe I can talk Wilcox into doing it. :)


Feb 13, 2012 at 6:02 PM

I started messing around with it and yeah, it looks like you could just write a GZipWebLoadRequest (inherited from WebLoadRequest and override a couple of methods) and you're done.

Once I get my WP7 environment working again I'll finish my spike and maybe write up a blog post or something.

Mar 26, 2012 at 11:49 AM

I blogged about a GzipWebLoadRequest I created:

Mar 28, 2012 at 12:09 PM

We just fixed a bug in the dev branch of AgFx over at GitHub so AgFx should soon be able to support Gzip through Mortens SharpGIS.GZipWebClient as documented on

When a new build of AgFx including that fix is pushed to NuGet you'll be able to just add these two lines to your App.xaml.cs (as described in the blog post) after referencing SharpGIS.GZipWebClient from NuGet as well:

WebRequest.RegisterPrefix("http://", SharpGIS.WebRequestCreator.GZip);
WebRequest.RegisterPrefix("https://", SharpGIS.WebRequestCreator.GZip);

And then AgFx will automatically take advantage of Gzip compression :)

Mar 28, 2012 at 5:02 PM

This has been merged to master, thanks guys!