ThinkGeo.com    |     Documentation    |     Premium Support

Review of the cache

I see lots of cache discussions, and I"m going to start running 426 in a couple of hours.   But I need guidance on the cache.


Here are my application requirements:



        
  • Our users select a "customer" for a worksession, and that customer typically has maps that are spread across a 20 x 20 mile area when zoomed all the way out.   With the detail work being in areas of about 1 mile by 1 mile.

  •     
  • We are using 1 or 2 meter resolution jpeg2000 imagery, pulled over a LAN 100mb LAN connection.  Typically two images are used to cover the area of one customer.

  •     
  • While working with that customer, the user may start and stop the application multiple times, so it would be nice to retain the cached imagery between sessions.

  •     
  • When they pick a different customer, it is likely that customer is hundreds of miles away.

  •     
  • A couple of days after working with the first customer, they may very likely work with that first customers neighbor, so could utilize the cached imagery from two days ago, if still available.

  •     
  • We are currently using the default single threaded mode.

  •     
  • I'm using the FileBitmapTileCache object on my image overlay with the two parameter constructor of cache folder and cache ID.

  •     
  • My cache ReadOnly is currently set to false.


Questions:



        
  • Can I configure a cache so that it retains the cached tiles between sessions?

  •     
  • If I do so, does the cache have a mechanism for "rolling out" the least recently accessed tiles when the cache gets to a specified size?   Or will it grow indefinitely.

  •     
  • If the cache does grow indefinitely, is there any reason that I could not provide a customer-specific cache, and manage that on my own by retaining the "20 most recently visited customers" kind of construct?

  •     
  • Does the ReadOnly property mean that the cache is never altered?  Or that it is allowed to grow as needed, but never deleted?

  •     
  • Can I build he cache tiles, on a background thread when the customer is selected?    So, when the customer is picked, the 20 x 20 mile area gets loaded as normal, but I know that the customer will want to see most of that imagery, at some point in time, at a 1 x 1 mile extent.   Can I start a background thread running that would start building those tiles in concert with any natural building that would occur as a function of user navigation on the main thread?

  •     
  • Should I be worried about any of the tile size parameters, etc?


Thanks!



Ted,


Sorry for the delay of answering your questions! Hope my following reply is not so late and can give you some help.
 
1) Of course, you could retain tiles between sessions by using the FileBitmapTileCache, and it would be easily achieved if you set the CacheDirectory & CacheId manually.
Following post is also talk about this topic, take a look if you are interested.
gis.thinkgeo.com/Support/Dis...fault.aspx
gis.thinkgeo.com/Support/Dis...fault.aspx
 
2) Itdepends on which kinds of TileCache you are trying to use, the InMemoryBitmapTileCache will have memory usage limitation, while the FileBitmapTileCache and SessionBitmapTileCache will grow indefinitely if the application is running forever.
 
3) Your idea of keeping the “20 most recently visited customers” is very similar to our InmemoryBitmapTileCache concept, while the difference InmemoryBitmapTileCache tiles will be lost when the application is turned off.
 
If you want, you could write your own CustomizedTileCache which probably inherits from BitmapTileCache to achieve what you want.
 
4) The ReadOnly property means that tiles will never be added or deleted and only the already existing tiles can be used, we fixed a bug in version 3.0.326 vs 3.0.415, so please make sure.
 
5) I think you can write your own logic to build the tiles, following post will discuss something and show some sample of it. Just take a look.
gis.thinkgeo.com/Support/Dis...fault.aspx
gis.thinkgeo.com/Support/DiscussionForums/tabid/143/aff/12/aft/6274/afv/topic/afpgj/1/Default.aspx#11328
 
6) If you screen size is normal, just ignore the tile size parameters, the default value will be suitable for most cases.
 
Any more questions or suggestions just feel free to let me know.
 
Thanks.
 
Yale