How does cache works

Topics: General
Sep 16, 2013 at 4:07 PM
I´m using the library in a project and I found it was a powerful tool. It´s cache facility made it a real profit to my project. Anyway, I need if someone can tell me a little bit of how it works. As far as I tested it, I can see that it pre-allocates space (in my case about 200 mb), so I started doing some test seeing how it worked, and it turns out it works really well, but in some cases I have been viewing maps that haven´t been cached. I don´t know if I have to spent some time with the position on the map so It can be cached or something like that. Does the tile cache file size increases with the time?, or it just keeps the prealocated size?.

Thanks in advance for any possible answer.
Sep 16, 2013 at 4:17 PM
Prealocation is +32MB if there are no empty pages left, and there is no size limit. Caching is done asynchronously with the lowest thread priority.

If you want to cache some area, you can use integrated tile prefetcher in demos.
Dec 14, 2015 at 8:50 AM
Hey radioman

I'm not sure if this thread is still open or if I have to make a new one?

Anyway, does the cache have some kind of expiry set to it? I downloaded a large are into cache during testing, then left the project alone for a few days. After running my application again the cache was empty.
Am I maybe missing a setting?
Dec 14, 2015 at 2:45 PM
cache has no expiration, you can clean it using MainMap.Manager.PrimaryCache.DeleteOlderThan

by default MainMap.Manager.Mode = AccessMode.ServerAndCache , meaning all downloaded tiles will be saved

maybe your mode is different, then no tiles would be saved, or maybe you closed your app too soon