Jump to content
We've recently updated our Privacy Statement, available here ×
  • How to Modify the caching values if your data does not update constantly


    djohnson53
    • Edited on:
    • Features: Ad Hoc, Cache Version: v8.2.0, v8.2, v8.1.1, v8.1.0, v8.1, v8.0.3, v8.0.2, v8.0.1, v8.0.0, v8.0, v8, v7.9.1, v7.9.0, v7.9, v7.8.1, v7.8.0, v7.8, v7.5.2, v7.5.1, v7.5.0, v7.5, v7.3.0, v7.3, v7.2.2, v7.2.1, v7.2.0, v7.2, v7.1.3, v7.1.1, v7.1.0, v7.1, v7, v6.9.0, v6.9, v6.7.0, v6.7, v6.6.0, v6.6, v6.5.1, v6.5.0, v6.5, v6.4.3, v6.4.2, v6.4.0, v6.4, v6.3.9, v6.3.1, v6.3.0, v6.3, v6.2.2, v6.2.1, v6.2.0, v6.2, v6.18.1, v6.18.0, v6.18, v6.17.0, v6.17, v6.16.0, v6.16, v6.15.0, v6.15, v6.14.0, v6.14, v6.12.2, v6.12, v6.11.0, v6.11, v6.10.0, v6.10, v6.1.1, v6.1.0, v6.1, v6.0.4, v6.0.3, v6.0.2, v6.0.1, v6.0.0, v6.0, v6, v5.6.2, v5.6.1, v5.6.0, v5.6, v5.5.2, v5.5.1, v5.5.0, v5.5, v5.4.1, v5.4, v5.3.0, v5.3, v5.2.0, v5.2, v5.1.2, v5.1.0, v5.1, v5.0.4, v5.0.3, v5.0.2, v5.0.1, v5.0.0, v5.0, v5, v4.8.0, v4.8, v4.7.1, v4.7.0, v4.7, v4.6.0, v4.6, v4.5.1, v4.5.0, v4.5, v4.2.1, v4.2, v4.1.3, v4.1.2, v4.1.1, v4.1, v4.0.2, v4.0.1, v4.0, v4 Product: JasperReports® Server

    To prevent too many requests from being sent to the underlying data source JasperReports Server caches the data used by the AdHoc designer. The Live time and the Idle time of those data can be personalized in the server configurations.

    Modify the caching values if your data does not update constantly

    Since version 5

    The properties previously defined in the dataSetCache bean of applicationContext-datarator.xml now need to be modified in adhoc-ehcache.xml.
    Also, note that times are now in seconds rather than minutes. By default, the timeToLiveSeconds is set to 30 minutes and timeToIdleSeconds is set to 90 minutes.

         Old name: defaultTimeoutMinutes
         New name: timeToLiveSeconds

         Old name: defaultUnusedTimeoutMinutes
         New name: timeToIdleSeconds

    timeToIdleSeconds: maximum time a cache item will stay in the cache if it's not used
    timeToLiveSeconds: maximum lifetime for a cache item, no matter how much it's used

    To change the values for both timeToLiveSeconds and timeToIdleSeconds find the cache names adhocCache under /apache-tomcat/webapps/jasperserver-pro/WEBINF/adhoc-ehcache.xml

        <cache name="adhocCache"
            timeToIdleSeconds="1800"
            timeToLiveSeconds="5400"
            overflowToDisk="false"
            diskPersistent="false"
            statistics="true" >
              <searchable>
                <searchAttribute name="id" expression="value.getId()"/>
                <searchAttribute name="lastAccessTime" expression="element.getLastAccessTime()"/>
                <searchAttribute name="creationTime" expression="element.getCreationTime()"/>
                <searchAttribute name="hitCount" expression="element.getHitCount()"/>
              </searchable>
        </cache>

    Prior to version 5

    In the applicationContext-adhoc.xml Spring configuration file, there are two parameters for when to clear the cache.

    The defaultTimeoutMinutes and defaultUnusedTimeoutMinutes properties, both in the dataSetCache bean, can be modified:

    The number of minutes to wait before removing a dataset from the cache. Ensures that stale data is periodically replaced with fresh data from the data source. The default is 60 minutes.

    •  defaultTimeoutMinutes: The number of minutes to wait before removing a dataset from the cache. Ensures that stale data is periodically replaced with fresh data from the data source. The default is 60 minutes. So if the value is set to something below 60, then it might be worthwhile testing it by setting it to the maximum value.
    • defaultUnusedTimeoutMinutes: The number of minutes to wait after a dataset is used before removing it from the cache. The default is 20 minutes. You might try setting this value to a higher value (something higher than the default 20).

    For more on these parameters, and Managing Ad Hoc Caching in general, refer to the latest documentation: JasperReports Server Admin Guide.


    Other Performance Tips:

    Measure and Test

    Ad Hoc

    Tomcat

    Database

    JasperReports Configuration Items


    User Feedback

    Recommended Comments

    There are no comments to display.



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...