Cache Setting

  • Last update:  2020-12-11
  • I. Overview

    1) FineReport provides a function to cache datasets to improve the speed of access. The idea is to download or save some data locally in advance, so that users do not need to download data from the database or platform in every visit.

    2) The dataset cache management and template cache can be set in FineReport Cache Management to meet different needs.

    II. Dataset Cache

    1. Description

    1) For reports with large data volume, if users need to read data from the dataset every time they read the dataset, it will not only affect the speed of report execution, but also cause greater pressure on the database.

    2) By setting dataset cache, Finereport can pre-cache the results of database query which can be reused directly when the same data set is used, to improve resource utilization.

    3) There are two options to cache dataset caches, one is to cache to memory, and the other is to cache to disk. The difference between the two is that the storage location is different, which will also bring other differences.


    2. Cache to memory

    1) Add database query, use the default dataset FRDemo, check [Shared Dataset] at the top of the dataset query window on the right, and select [Save All Records in Memory].

    2) Result of the setting: After executing the query, the query results will be cached to memory. The next time this dataset is used, templates will directly read the result from the memory.

    3) Usage scenarios: The space of memory is limited. However, the speed at which the data are loaded is very fast. This setting is frequently used when the data volume is not too large and the database tables are used more frequently.


    3. Cache to disk

    1) Add database query, use the default dataset FRDemo, check [Shared Dataset] at the top of the dataset query window on the right, and select [Save All Records in Memory].

    2) Enter the number of rows: The number of rows is greater than 0 by default, which means that all data are cached to disk. If the number of rows is greater than 1,000, then it means that the first 1,000 rows of data are stored in memory while the rest are stored in disk.

    3) Cache to disk means storing results in the server’s disk. By default, all cache files are located in C:\Users\Username\.FineReport100\cache (in a Windows system).

    4) Result of the setting: Data sheets with large data volumes can be stored in disk to avoid memory overflow. Usage scenarios: For reports that require large volume of data, or the situation when there are tens of thousands of data, you can cache some data to memory while caching the rest to disk to improve efficiency.


    4. Dataset sharing

    1) Max Datasets No.: The maximum number of datasets that can be cached. If this limit is exceeded, the server will remove cache files based on Cache Principle.

    2) Cache Principle:

    • Recently Used: Remove the cache files that are not used for the longest time.

    • The Least Used: Remove the cache files that are least used.

    • First In First Out: Remove the cache files that are generated the most early.

    3) Max Idle Time: The time interval between the last time the cache is accessed and the time the cache is removed.

    4) Max Time to Live: The time interval between the time the cache is created and the time the cache is removed.

    III. Template Cache

    1. Template Cache Attribute Setting

    1) Always Reread Report: Refers to whether to cache cpt or frm files to memory.

    2) The Always Reread Report is enabled by default. In this case, the system will reread templates from the disk every time. If it is enabled, as long as the disk files remain unchanged, the system will read templates from the memory first.


    Attachment List


    Theme: Decision-making Platform
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy