saveToCache Method

Summary

Saves the document to the cache.

Syntax
TypeScript
JavaScript
saveToCache = function( 
   doc 
) 
static saveToCache( 
   doc: LEADDocument 
): JQueryPromise<void>; 

Parameters

doc

The document to save. Must not be null.

Return Value

A Promise object that may resolve successfully to a LEADDocument object, or fail if the LEADDocument cannot be saved to the cache.

Remarks

<returns> A Promise object that may resolve successfully to a LEADDocument object, or fail if the LEADDocument cannot be saved to the cache. </returns>

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.

SaveToCache can be used to save a document to the cache and re-loading it using DocumentFactory.LoadFromCache.

The document is only saved into the cache if the value of CacheStatus is DocumentCacheStatus.NotSynced. When SaveToCache returns successfully, the value of CacheStatus of the document will be DocumentCacheStatus.Synced and the value of LastCacheSyncTime will contain the timestamp of the operation.

Refer to Document Toolkit and Caching for more information.

Example

For an example, refer to Create.

Requirements

Target Platforms

Help Version 20.0.2020.4.3
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Document Assembly