The Cache property returns a collection of the records of the repository object cache.
Object cache contains instances of the object that was opened with the determined values of parameters. Presence of record that corresponds to these parameters in the cache is checked when opening the object with any parameters. If the record is found, it will be extracted and the cached version of the object will be opened. If the record for the specified parameters is not present, the object will be opened. All objects on which this object depends, will also be opened. Regular reports support caching of the object instance.
The object cache is stored in the repository base.
Executing the example requires a form with the Button1 button, the ReportBox component and the UiReport component named UiReport1. The UiReport1 component is a source of data for the ReportBox component. There is a regular report with the "Report_1" identifier in the repository.
Add links to the Metabase, Ui system assemblies.
After executing this example the information about the records in the object cache is displayed in the development environment console. Date and time of creation and the list of values of parameters with which the regular report was opened in that moment are displayed for each record. Records that were created more than one month ago, are removed. If the records remain in cache after removal, the object instance that stored in the last remained record is loaded into the UiReport1 component. If all records are removed in cache, the report opened from repository is loaded into the UiReport1 component.
See also: