Blueworx Voice Response VoiceXML browser grammar fetch / cache

When a Blueworx Voice Response VoiceXML application accesses speech technologies for voice recognition and text to speech (TTS), the proper set up of grammar fetch / cache is critical to application performance.

Default behavior

The default mechanism for accessing grammars when using Blueworx Voice Response/WebSphere Voice Server and VoiceXMl 2.x is for the Blueworx Voice Response VoiceXML browser to fetch the grammar from either a web server or a file based on the URI referenced in the <grammar> tag, and pass the fetched document in-line within the speech request to WebSphere Voice Server. When WebSphere Voice Server receives the grammar it will compile the grammar as an in-line grammar ready for use for the next recognition request.

This mechanism works well when used for small numbers/sizes of grammars and was intended for use with earlier releases of WebSphere Voice Server, which did not contain the current levels of caching capabilities and caching policies. The problem with the solution is that speech server does not cache the grammars, so the grammars are recompiled for each recognition request. This is not normally a problem when used with smaller grammars, but can cause performance overheads when used with larger, more complex grammars.

This mechanism remains the default to ensure compatibility with earlier speech technologies.

Alternative behavior

The recommended behavior when using Nuance Speech Server or Lumenvox (for supported levels see https://blueworx.zendesk.com/hc/en-us/articles/216765907-Blueworx-Voice-Response-Supporting-software-tested-levels) is to move the grammar fetch responsibility from Blueworx Voice Response to the MRCP speech server. This mechanism improves performance for large grammars because:

To enable this behaviour:
  1. Edit $DTJ_HOME/dtj.ini
  2. Add the following parameter:
    wvr.vxml2.grammar.fetch.external =false
This alternative fetch behaviour will be applied to grammar http, https and built-in: grammar URI references. file:// grammar references will continue to be fetched from the local Blueworx Voice Response file system and cached using the default file caching policies.

Grammar file location

Blueworx Voice Response supports the storage of grammar files on a web server ( http:// ) or on the local file system (file:// ) if the content of the grammar files is likely to be static. The preferred mechanism for retrieving grammar files is to use a web server because:

WebSphere Voice Server only supports the use of grammars referenced on a web server ( http:// ). Although it will except and fetch documents with a file:// URI reference, it will log this as a warning that the application has an error, The use of the file:// reference may provide I/O restrictions that can impact a real time system and is therefore viewed as unsupported by WebSphere Voice Server support.

It is also Blueworx’s recommendation not to use relative URI references, especially when files are retrieved from more than one source as it becomes difficult to resolve the absolute reference for the document to be fetched.