action_="cachectrl"

<do action_="cachectrl"> controls cache behavior and inspects cache statistics. (Available as of version 10.25)

Syntax

<dynamic cache_stats="{pkg(;)}" set_data="{pkg(;)}">
    <do action_="cachectrl" value_="@cache_stats" 
     set_="@set_data" clear_="[CACHES_TO_CLEAR]"/>
       [1010data_QUERY]
</dynamic>

Attributes for action_="cachectrl"

value_
All of the cache statistics and their values are saved as a package to the dynamic variable specified by the value_ attribute.

The variable must be declared as a package in the opening <dynamic> tag of the QuickApp (e.g., <dynamic var_name="{pkg(;)}">).

The package will contain information for the following keys:

Statistics (read-only)
  • dynamic_cache_size
  • block_cache_size
  • block_cache_entries
  • loop_cache_size
  • loop_cache_entries
  • temp_cache_size
  • state_cache_size
  • state_cache_entries
  • xlt4ops_cache_size
  • constvals_cache_size
Limits (read/write)
  • block_cache_length
  • temp_cache_limit
  • temp_cache_limit_mb
  • state_cache_limit
  • gres_cache_pvlimit
Boolean flags (read/write)
  • block_cache_enabled
  • loop_cache_enabled
  • link_cache_enabled
  • temp_cache_enabled
  • gfun_cache_enabled
  • gfun_cache_compress
  • gres_cache_enabled
set_
Specify a dynamic variable that consists of a package with the key/value pairs to set. Invalid keys are ignored.

The variable must be declared as a package in the opening <dynamic> tag of the QuickApp (e.g., <dynamic var_name="{pkg(;)}">).

Note: Setting some values may automatically clear certain caches.
Values can be set for the following keys:
Limits (read/write)
  • block_cache_length
  • temp_cache_limit
  • temp_cache_limit_mb
  • state_cache_limit
  • gres_cache_pvlimit
Boolean flags (read/write)
  • block_cache_enabled
  • loop_cache_enabled
  • link_cache_enabled
  • temp_cache_enabled
  • gfun_cache_enabled
  • gfun_cache_compress
  • gres_cache_enabled
clear_
Specifies the caches to clear. Accepts a comma-separated list or a list-value.
The items in the list can be one or more of the following:
  • mdb
  • block
  • constvalues
  • loop
  • temp
  • materialize

The action selectively clears the respective caches.

Example

The following example uses <do action_="cachectrl"> to save cache statistics to the dynamic variable cachestats. It then displays the dynamic cache size, block cache size, and loop cache size in separate text widgets.

<dynamic cachestats="{pkg(;)}">
  <do action_="cachectrl" value_="@cachestats"/>
  <layout arrange_="v">
    <widget class_="text" 
     text_="Dynamic cache size: {@cachestats.dynamic_cache_size}"/>
    <widget class_="text" 
     text_="Block cache size: {@cachestats.block_cache_size}"/>
    <widget class_="text" 
     text_="Loop cache size: {@cachestats.loop_cache_size}"/>
  </layout>
</dynamic>