This project has moved. For the latest updates, please go here.

GZip support

Feb 13, 2012 at 12: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: http://www.sharpgis.net/

 

Feb 13, 2012 at 12:46 PM

+1 on GZip support. I saw the post from Jeff Wilcox on this (http://www.jeff.wilcox.name/2012/01/windows-phone-gzip-support-by-morten/) 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).

Coordinator
Feb 13, 2012 at 5: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. :)

Shawn

Feb 13, 2012 at 5: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 10:49 AM

I blogged about a GzipWebLoadRequest I created:

http://www.michielpost.nl/PostDetail_58.aspx

Mar 28, 2012 at 11:09 AM

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 http://www.sharpgis.net/post/2011/08/28/GZIP-Compressed-Web-Requests-in-WP7-Take-2.aspx

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 :)

Coordinator
Mar 28, 2012 at 4:02 PM

This has been merged to master, thanks guys!