ThinkGeo.com    |     Documentation    |     Premium Support

Cache Types

Greetings,


I'm just getting into optimizing the rendering performance by using caches, and was wondering if you could describe each type of cache and how each specific type of cache helps in the performance of the application.


Thanks in advance,


Ryan



Ryan, 
  
 I would be very glad if my following descriptions would give you any helps. 
  
 Now we have provided three kinds of BitmapTileCache : InMemoryBitmapTileCache, FileBitmapTileCache, SessionFileBitmapTileCache. 
  
 The difference between the InMemoryBitmapTileCache vs FileBitmapTileCache  is as its name said, the cached tiles is saved in memory vs disk, so when the application is shut down, the tiles for the InMemoryBitmapTileCache will go away, while the FileBitmapTileCache can be persistent in disk, while it is probably the InmemoryBitmapTileCache would be fast if not too much memory was taken up. 
  
 The SessionFileBitmapTileCache is very similar to FileBitmapTileCache, while the special place is that when your call the ClearCache , the SessionFileBitmapTileCache will not clear the cached tiles immediately as FileBitmapTileCache did, it will only created a new folder for its new caches. Meanwhile, a background thread will be started to delete those obsolete cached folders. 
  
 Any more questions please feel free to let me know. 
  
 Thanks. 
  
 Yale 


Yale,


Thanks for your reply, that helps me out a lot.  Could you tell me the difference between TileCache and PreviewTileCache on an overlay?


Thanks,


Ryan



Ryan, 
  
 The preview image is the image shown on map control when it is still drawing on background and the preview image can only work when the ThreadMode is MultiThreadMode and the tile cache is turned on. 
  
 So it is obvious that the TileCache is for the TileImages itself while the PreviewTileCache is for the PreviewTileImages. And you do not need to worry about it when you using the SingleThead mode or without turning on the TileCache. 
  
 If I am not clear enough just feel free to let me know. 
  
 Thanks. 
  
 Yale