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_sizeblock_cache_sizeblock_cache_entriesloop_cache_sizeloop_cache_entriestemp_cache_sizestate_cache_sizestate_cache_entriesxlt4ops_cache_sizeconstvals_cache_size
- Limits (read/write)
-
block_cache_lengthtemp_cache_limittemp_cache_limit_mbstate_cache_limitgres_cache_pvlimit
- Boolean flags (read/write)
-
block_cache_enabledloop_cache_enabledlink_cache_enabledtemp_cache_enabledgfun_cache_enabledgfun_cache_compressgres_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_lengthtemp_cache_limittemp_cache_limit_mbstate_cache_limitgres_cache_pvlimit
- Boolean flags (read/write)
-
block_cache_enabledloop_cache_enabledlink_cache_enabledtemp_cache_enabledgfun_cache_enabledgfun_cache_compressgres_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:
mdbblockconstvalueslooptempmaterialize
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>

