XQuery Function Documentation

Search and Browse

http://exist-db.org/xquery/cache

java:org.exist.xquery.modules.cache.CacheModule

A module for accessing global caches for sharing data between concurrent sessions

cache:cleanup#1

cache:cleanup($cache-name as xs:string) as empty-sequence()

Eviction policy work of the cache is performed asynchronously. Performs any pending maintenance operations needed by the cache, on the current thread. Typically not needed by users, and only used for testing scenarios. Requires 'clear' permissions.

Parameters:
$cache-nameThe name of the cache
Returns:
empty-sequence()

cache:clear#0

cache:clear() as empty-sequence()

Clears all key/values from either all caches or the named cache

Returns:
empty-sequence()

cache:clear#1

cache:clear($cache-name as xs:string) as empty-sequence()

Clears all key/values from either all caches or the named cache

Parameters:
$cache-nameThe name of the cache
Returns:
empty-sequence()

cache:create#2

cache:create($cache-name as xs:string, $config as map(*)) as xs:boolean

Explicitly create a cache with a specific configuration

Parameters:
$cache-nameThe name of the cache
$configA map with configuration for the cache. At present cache LRU and permission groups may be specified, for operations on the cache. `maximumSize` is optional and specifies the maximum number of entries. `expireAfterAccess` is optional and specifies the expiry period for infrequently accessed entries (in milliseconds). `expireAfterWrite` is optional and specifies the expiry period after the entry's creation, or the most recent replacement of its value (in milliseconds). If a permission group is not specified for an operation, then permissions are not checked for that operation. Should have the format: map { "maximumSize": 1000, "expireAfterAccess": 120000, "expireAfterWrite": 240000, "permissions": map { "put-group": "group1", "get-group": "group2", "remove-group": "group3", "clear-group": "group4"} }
Returns:
xs:boolean : true if the cache was created, false if the cache already exists

cache:destroy#1

cache:destroy($cache-name as xs:string) as empty-sequence()

Destroys a cache entirely

Parameters:
$cache-nameThe name of the cache
Returns:
empty-sequence()

cache:get#2

cache:get($cache-name as xs:string, $key as xs:anyType+) as item()

Get data from identified global cache by key

Parameters:
$cache-nameThe name of the cache
$keyThe key
Returns:
item()* : The value associated with the key

cache:keys#1

cache:keys($cache-name as xs:string) as xs:string

List all keys stored in a cache. Note this operation is expensive.

Parameters:
$cache-nameThe name of the cache
Returns:
xs:string* : The keys in the cache. Note these will be returned in serialized string form, as that is used internally.

cache:list#2

cache:list($cache-name as xs:string, $keys as xs:anyType*) as item()

List all values (for the associated keys) stored in a cache.

Parameters:
$cache-nameThe name of the cache
$keysThe keys, if none are specified, all values are returned
Returns:
item()* : The values associated with the keys

cache:names#0

cache:names() as xs:string

Get the names of all current caches

Returns:
xs:string* : The names of all caches currently in use.

cache:put#3

cache:put($cache-name as xs:string, $key as xs:anyType+, $value as item()*) as item()

Put data with a key into the identified cache. Returns the previous value associated with the key

Parameters:
$cache-nameThe name of the cache
$keyThe key
$valueThe value
Returns:
item()* : The previous value associated with the key

cache:remove#2

cache:remove($cache-name as xs:string, $key as xs:anyType+) as item()

Remove data from the identified cache by the key. Returns the value that was previously associated with key

Parameters:
$cache-nameThe name of the cache
$keyThe key
Returns:
item()* : The value that was previously associated with the key