Client Configuration Cache

Client Configuration Cache

The client configuration cache file contains the current cluster configuration that Couchbase Server uses at startup.

Note: Use of the configuration cache applies only to PHP (not to Java and .NET).

The majority of the Couchbase clusters are running in a steady state most of the time, which means that the cluster nodes are not removed or added very often. Since clients only infrequently receive an update from the cluster whose topology is changing, cluster information is well suited for client-side caching.

When the client is instantiated, it looks for a cached named file in the file system. If the file is there, the client assumes that it belongs to a current cluster configuration and starts using it. If it isn't there, the client starts a normal bootstrap to get the configuration from the cluster and writes it to a file.

Whenever you try to access an item on a node and the node tells you that you tried to communicate with the wrong node (NOT_MY_VBUCKET), you invalidate the cache and the SDK automatically requests a new copy of the configuration. In newer versions of Couchbase Server (v2.5 and higher) and SDKs, do not have to request the configuration, but it is automatically received from the Couchbase node as part of the NOT_MY_VBUCKET error response.

To use the configuration cache from PHP, add the following to the file php.ini:
couchbase.config_cache = /tmp