Caching operational data

If you are providing operational data using the Data Provider API, it is possible to have the operational data cached by ConfD for a configurable period of time, so that if a new request for that data is received, ConfD will return the value from the cache instead of invoking the Data Provider again.

Operational data caching is not enabled by default, so you need to enable this in your ConfD configuration, as well as provide a default value in seconds for the amount of time to hold the data in the cache. See the /confdConfig/opcache section of the confd.conf manpage for details.

In addition to the enabling the cache in your ConfD configuration, you need to add an annotation in your YANG model for operational data that you want cached. So in addition to the call point you would add an additional clause to indicate this data can be cached. For example

tailf:callpoint a1 {
    tailf:cache true;

Note that you can additionally override the default duration the data is held in the cache by specifying a timeout value in your model.

You can additionally invalidate the cache, either partially or completely, by using the maapi_clear_opcache() function.