ThinkGeo.com    |     Documentation    |     Premium Support

FileBitmapTileCache ExpirationTime

How does the property ExpirationTime in ThinkGeo.MapSuite.Core.FileBitmapTileCache work?
I tried setting it to 30 seconds to see if any tiles got deleted byt nothing seemed to happen.

In general it is difficult to figure out what ThinkGeo properties do because the API documentation is so bad (non existing).

Hi Morten,

There is no logic to check whether the entire cache expire when the application starts. We will check if one tile cache is expired before this tile is loaded.
Note: we view the created time of cached image to determine whether this cached image is expired.

Please set the “TileAccessMode” property in FileBitmapTileCache to “ReadOnly”, then the application will delete the expired tile cache.
And the default value of this property is “ReadAddDelete”, in this case, when a tile cache has expired and this tile will be rebuilt and cached. Please see the attached which shows the cached image has been modified after the tile cache is expired.

If I misunderstood anything, please provide more information.

Thanks,
Emil

Thanks for you reply.

Just to make sure I understand it correctly:

In my example I use OpenStreetMapOverlay and because I want to store the tiles in a specific location I assign a FileBitmapTileCache to it.

I do not create the cache up front but instead it is filled up as the user navigates around the world, so I cannot set TileAccessMode to ReadOnly.
So I use ReadAddDelete and from your example and what I have tried I can see that tiles are updated depending on what I set ExpirationTime to.
So e.g. setting ExpirationTime to 30 seconds and then after 31 seconds I pan/zoom so a tile is reloaded and then the file is updated in the cache.
And in that case tiles (that are never used) will never be deleted, correct?

To delete the entire cache I will just have to implement my own logic to see when/if the layer is used.

Hi Morten,

Yes, you are right. The tiles will never be deleted if they are never used.

Thanks,
Peter