Managing Cached Resources for Speech Engine Services

Managing Cached Resources for Speech Engine Services

This topic explains how Speech Engine Services (SES) caches grammars, and provides instructions on how to clear cached resourses in SES.

Caching Grammars

If multiple speech applications have QA controls that refer to the same grammar file (Reco.Src = someurl), the SES computer fetches and compiles the grammar only once. If the same grammar is used in multiple simultaneous recognitions, some memory is shared but there is additional memory overhead in each engine the grammar is loaded into.

Inline grammars (Reco.InlineGrammar) are never cached.

There is no difference between precompiled grammars (.cfg) and .grxml files with respect to how they are cached. SES never needs to be restarted due to preload list changes. A .cfg file loads faster because it is the compiled form of a .grxml file.

When a grammar file (.cfg or .grxml) is updated on a server, SES detects the change based on the grammar's expiry time as reported by the Web server. After the grammar expires, it will be rechecked the next time it is requested. If no explicit expiry time is set, Microsoft Speech Server assumes the grammar will never expire and will not check again until an explicit cache reset.

"Freshness" Lifetime

For increased performance, other resource files such as prompt databases and wave files are also cached. Caching of individual resources is controlled by a freshness lifetime, determined at the time the resource is downloaded.

SES sets the freshness lifetime to 10 percent of the resource age. Resource age is the difference between the download time and the last-modified time. The maximum freshness lifetime is one day. The minimum is one minute.

When the freshness lifetime expires, resources are considered stale. They are still cached, but their validity, determined by whether or not they are updated, is checked on the next access, using standard HTTP if-modified-since rules. A new freshness lifetime is determined, and they are updated if needed.

Clearing Cached Resources

You can clear the cached resources for SES using the Microsoft Management Console (MMC) snap-in for Microsoft Speech Server (MSS). For SES, this request causes the service to reload the application manifest file and all associated resources.

This procedure clears the entire cache, which causes all cache entries to be marked as stale.

To Clear Cached Resources for SES
  1. Open the MMC Administration console. (For instructions, see Administering Speech Server Using MMC.)

  2. In the console tree, double-click Microsoft Speech Server and then double-click the applicable group.

  3. In the details pane, right-click the applicable SES computer, point to All Tasks, and then click Clear Cached Resources.

For more information, see "Managing Application Resources" and "Application Manifest Files" in Microsoft Speech Application SDK Version 1.1 (SASDK).

See Also

Clearing Cached Resources for Telephony Application Services