A newer version of this documentation is available.

View Latest

Configuration Cache-File

    The client configuration cache-file records the current cluster-configuration, which Couchbase Server uses at startup.

    How the Cache-File is Used

    Client applications use libcouchbase to connect to Couchbase Server. By means of libcouchbase, the client can react to changes in cluster-topology. Whenever the client is started, libcouchbase is instantiated, and checks the local filesystem for a configuration cache-file, containing information on the cluster-toplogy. If no such file exists, libcouchbase connects to the cluster by means of a REST method, in order to receive the latest topology-details. Once acquired, these details are written to the configuration cache-file, locally.

    Subsequently, when starting, the client uses the local configuration cache-file to acquire its topology-data. If at any time, when using this data, the client attempts to access a data-item on a node, and is informed by Couchbase Server that the node is incorrect (due to the cluster-configuration having changed), the current configuration cache-file is duly invalidated. The client then requests an updated set of toplogy-details from Couchbase Server; which are themselves then saved locally by the client, as a new configuration cache-file.

    Use of the configuration cache-file is available only through PHP (not through Java or .NET). Modifying config_cache is best done in the connection string:

    $connection = new \Couchbase\Cluster("couchbase://");