Cache template calculation result

  • Last update:  2021-06-02
  • I. Overview

    1. Application scenario

    When accessing the report, if the data calculation amount of the template is large, the data will be re-read from the server for calculation each time the access is made, which increases the pressure on the server and slows down the access to the report. This can be set the template calculation result is cached to solve this problem.


    2. Function introduction

    After setting the cache of template calculation result, when the visited template is accessed again, the calculation result is directly read from the cache to reduce the pressure on the server and improve the access speed of the report.


    3. Principle

    The principle description is as follows:

    • Client A accesses the template on the server, reads it from the database, generates the desired template result file, caches it in the memory, and sends it back to Client A.

    • When client B accesses this template on the server, if the returned result is the same as the result returned by client A, it will not read from the database, but directly read the template data cached by A, and then send it back to client B.

    1.png

    Note 1: Currently only cpt template calculation result caching is supported.

    Note 2: Read the template calculation result cache must meet: the same template and have the same parameters.

    II. Steps

    Cache the template calculation result has two opening methods, and the cache data validity period of the two opening methods is different.


    1. Open by using __cache__ parameter

    Add &__cache__=true to the path to the report, which means that the report is enabled for calculation result caching, as shown below:

    http://localhost:8075/webroot/decision/view/report?viewlet=GettingStartedEN.cpt&__cache__=true

    Note 1: As long as the system does not have GC (Garbage Collections), the cache will always remain.

    Note 2: When reading data from the cache, add &__cache__=true after the URL.


    2. Set report cache effective time

    In the designer, click "Template>Web Attributes>Basic" and fill in the "Report Cache Effective Time" to open it. The setting page is as shown in the figure below:

    Note: The value of "Report Cache Effective Time" is an integer greater than 0. After the effective time is reached, the cached data will be cleared.

    2.png

    Attachment List


    Theme: Performance Optimization
    Already the First
    Already the Last
    • 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