←Select platform

AutoDeleteFromCache Property


Indicates whether to delete all the entries that belong to this document from the cache when it is disposed.

public bool AutoDeleteFromCache {get; set;} 
Public Property AutoDeleteFromCache() As Boolean 
   property bool AutoDeleteFromCache 
      bool get() 
      void set(bool value) 
public boolean getAutoDeleteFromCache() 
public void setAutoDeleteFromCache(boolean value) 

Property Value

true to delete all the entries that belong to this document from the cache when it is disposed; otherwise, false. The default value is true.


Documents can contain large number of pages and huge amount of data. Storing all this data in the physical memory is not feasible in most situations. Therefore, the LEADDocument class was designed to use an external caching system to store the modified. Refer to DocumentFactory.Cache for more information.

HasCache determines if this document is using the cache system. SaveToCache can be used to save a document to the cache and re-loading it using DocumentFactory.LoadFromCache.

Set AutoDeleteFromCache to true if your application uses cache to speed up processing the document and the object will not be used after it is disposed.

Set AutoDeleteFromCache to false if your application will save the document ID before disposing the document and use it to re-load the document using DocumentFactory.LoadFromCache.

To save the document to the cache, use SaveToCache or set the value of AutoSaveToCache to true before disposing the document.

When dispose is called, the following occur:

If the cache object used supports regions (DefaultCacheCapabilities.CacheRegions), then DeleteRegion.

If the cache does not support regions, then ObjectCache.DeleteAll is called with regionName set to DocumentId and the value of GetCacheKeys passed as the keys.

Refer to Document Toolkit and Caching for more information on how the cache is used with the LEADTOOLS Document library and how to set up optional custom cache provider.

Note that setting this property to a value will update the same value in each child document.


For an example, refer to DocumentId.

Target Platforms
Help Version 21.0.2021.3.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Document Assembly