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

Alternatives to using SharpMap.Web.Cache

Topics: General Topics
Feb 13, 2007 at 4:52 AM
Hey there,

At the moment, when I use SharpMap to generate an image from the Map.GetMap() method, I find that the response is unreliable. Sometimes the URL provided to my ImageButton works and there is a map shown, but other times there is no map present at the URL returned from the cache. I am using the following lines to put hte map into the HttpCache and to retrieve the URL:

string strImgID = SharpMap.Web.Caching.InsertIntoCache(1, map.GetMap());
return @"getmap.aspx?ID=" + HttpUtility.UrlEncode(strImgID);

Can anyone suggest a better way of doign this, so as to avoid the inconsistent performance of the cache? For example, would I be better off writing the image to a file or memory stream?


Steve - Melbourne/Australia

Feb 16, 2007 at 3:46 AM
Try using the session object (just remember to remove it from the session when you have retrieved it)