I need to update my application when there are configuration changes on the server. To achieve this, I am using the StatusViewer application sample to retrieve updated event names from the server.
I tested the sample by creating a new user-defined event and then modifying its name. However, the application continues to display the old name even after the change.
Do I need to make any additional changes to retrieve the updated event name?
Could you please suggest if there is a way to get the modified event name correctly?
The caching behavior was changed as part of an optimization in the MIP SDK. Unfortunately, the sample was not updated to reflect this change.
There are two ways to update the sample that will resolve the issue you’re seeing.
Option 1 — clear the cache when needed
Add the following line at line 262 in MainForm.cs:
VideoOS.Platform.Configuration.Instance.ConfigurationApiManager.ClearCache(); //added to the sample
var configItem = VideoOS.Platform.ConfigurationItems.Factory.GetConfigurationItem(detail.FQID); // original line 262
Option 2 — disable REST API caching entirely
Add the following line to the OnLoad method in MainForm.cs:
VideoOS.Platform.Proxy.ConfigApi.ConfigurationApiManager.EnableRestApiCaching = false;
// added to the sample to ensure we always get the latest configuration data from the server
If you are working with ConfigurationItem in a scenario where you must always read the most up-to-date configuration, use the second option.
If you need to read many items and cached values are acceptable, the first option provides better performance by clearing the cache only when required.