Cache Management Using BAM

Management of Cache Entries

It is possible to view, expire and remove cache entries on the Blueworx Platform using the bam --cache command, followed by the name of an action to perform. By default, if no optional arguments are supplied, all cache commands will apply to VoiceXML, CCXML and AUDIO caches and will display results using the simple view (a list of keys, which are usually the URI of the resource).

The bam --cache command manages cache entries on every connected BVR within the cluster.


view Displays a list of cache entries
expire Expires cache entries by setting the expiration time to a date in the past. Expire will ask for confirmation unless the force option is specified.
remove Removes cache entries. If an application is using or about to use a cached resource and the remove command is used on that resource, it will be marked for removal and removed from the list, then removed from the filesystem when all applications using it have completed. Once an entry has been marked for removal, any new applications trying to use that resource will have to re-fetch it. Remove will ask for confirmation unless the force option is specified.

Optional Parameters

Optional parameters can appear in any order after the action.

View Mode

There are 4 view modes. The default is "simple".

simple Shows a list of keys for each cache entry (where the key is usually the URI of the resource)
table Shows a table of all the cache entries matching the command. This shows: BVR - The IP address of the BVR system the cache entry is on. Cache - The cache the item is in. Expiry Time - The time that the resource expires. See "Expiry Time in the Cache Command" for further details on this. Size - The size of the content of the cache entry in a human readable format. Key - the "key" of the cache entry.
detail Shows a detailed view for each cache entry. The information displayed may change depending on the data stored, including any associated cache directives
json Shows the full metadata for each cache entry in JSON format

Limiting the scope of the cache entries a command applies to

The "cache" Option

Specifies which cache the command applies to. This field can appear multiple times. For example, to expire all entries in the VoiceXML and AUDIO caches, the following can be run:

bam --cache expire cache=AUDIO cache=VXML

The "where" Option

The where option filters which entries a command applies to by specifying a field name and its expected value. Currently the only supported field name for this option is "key". The value can be made a wildcard using a *. The format for this option is where="[FIELD_NAME]=[WILDCARD_VALUE]". The value is case sensitive.

For example, to filter all results where the key contains the word welcome, run:

bam --cache view where="key=*welcome*"


View a table of all AUDIO and VoiceXML cache entries containing the word "welcome":

bam --cache view table cache=AUDIO cache=VXML where="key=*welcome*"

Expire all VoiceXML entries, require confirmation

bam --cache expire cache=VXML

Remove all CCXML cache entries without confirmation

bam --cache remove cache=CCXML force

Expiry Time in the Cache Command

When viewing cache entries, the "Expiry" field may be displayed. This is the time at which the platform actually expects the resource to expire. It will take into account the max-age cache directive if set (this takes presedence over Expires). This field will also indicate if the resource has already expired and if it was force expired by the user running the expire command.

The expiry information stored is the expiry information associated with that resource taken from Cache-Control directives from the web server and, in VXML and CCXML's case, any Cache-Control directives in an http-equiv meta tag. Setting maxage or maxstale when fetching a resource, for example when setting maxage on the <audio> tag, only applies to that specific request and will not affect the expiry time associated with the resource itself.

Further Information