Caching the VoiceModel in ASP.NET MVC
Caching the VoiceModel and state machine for an ASP.NET MVC VoiceXML application is very simple. In the previous post Where is the Controller For an MVC VoiceXML Application I demonstrated how to create a voice application to get the current weather conditions in an area identified by a zip code. In this post the VoiceModel and state machine were recreated each time the controller was called. I have modified the example to cache this information by slightly modifying the Builder classes for the VoiceModel and state machine. The Builder classes follow the Builder design pattern and are responsible for building the object graphs that represent the application VoiceModel and call flow. It makes sense to handle the caching in these classes since they are responsible for creating these objects. Here is what the class for the state machine builder looks like now. public class WeatherCallFlowBuilder { const string cacheId = "weather.cf"; public static ICallFlow B