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

Why don't integrate GeoCache project directly into SharpMap WMS Server?

Mar 31, 2010 at 10:37 AM

I take a look into

Why don't integrate it directly into SharpMap WMS Server?

In this way we will have a nice WMS Server that include tile caching features...   

Or...  i can start a new external project to continue the development of geocache .....  but in some place i would modify it and rend it more simply to use...    

something like:  ok configure the WMS Server you want to "cache"....   configure the cache strategy...  and nothing more...      it ask automatically the server capabilities  to the original one and it provide ALL the layers that the original one can provide....     it should be a dream??  no?? 


Who want to help me?




Mar 31, 2010 at 11:01 AM

Hi Alberto, the v2 web layer has caching built in, though it isnt based on geo cache.. hth jd

Apr 1, 2010 at 12:00 PM

hi Alberto,

My choice would be to keep the WMS and TileCache tool as separate components, so that you could replace either one with alternatives. Maybe the manager that you describe should be a separate tool too. 

The manager could import a WMS capabilities and then present all the layers and allow people to select the layers that they would like to cache. There are a lots of choices to be made there, because a WMS can present its data in all possible projections and you could choose to combine several layers in a single cached tile. You have to select an extent too. You could present the user with some conventional defaults to make it easy. The manager could generate a config file for the TileCache tool. Currently it is quite cumbersome to get a TileCache configured so it would be great to have such a manager tool!



Apr 1, 2010 at 12:01 PM

@johndiss How does the caching work? Does it cache whatever is requested or do you use some schema? And how do you deal with combinations of layers?


Apr 1, 2010 at 4:15 PM
Edited Apr 1, 2010 at 4:51 PM
 public interface IMapCacheProvider
        bool ExistsInCache(IMapRequestConfig config);
        void SaveToCache(IMapRequestConfig config, Stream data);
        Stream RetrieveStream(IMapRequestConfig config);
        void RemoveFromCache(IMapRequestConfig config);

    public interface IMapCacheProvider<TMapRequestConfig, TOutput>
        : IMapCacheProvider<TMapRequestConfig>
        where TMapRequestConfig : IMapRequestConfig
        Func<TOutput, Stream> ConvertToStreamDelegate { get; }
        Func<Stream, TOutput> ConvertToObjectDelegate { get; }
        TOutput RetrieveObject(IMapRequestConfig config);
        void SaveToCache(IMapRequestConfig config, TOutput data);

    public interface IMapCacheProvider<TMapRequestConfig> : IMapCacheProvider
        where TMapRequestConfig : IMapRequestConfig
        bool ExistsInCache(TMapRequestConfig config);
        void SaveToCache(TMapRequestConfig config, Stream data);
        Stream RetrieveStream(TMapRequestConfig config);
        void RemoveFromCache(TMapRequestConfig config);

IMapRequestConfig is an abstract configuration for the request i.e it configures the handler and potentially has knowledge about the requested layers etc.
at any rate it can produce a unique key for that request. Multiple cache providers can be used to cache in Ram, file system, db etc and basically store a byte[]/stream it is then up to the Delegates to convert between the thing to cache: bitmap, json string , xml etc and the stream.


hth jd