An Implementation of Buck's HTTP Cache API as a distributed cache service.
Switch branches/tags
Nothing to show
Clone or download

Buck HTTP Cache As a service.

An Implementation of Buck's HTTP Cache API as a distributed cache service.

Quick start

Standalone mode

Standalone mode starts this in a single node mode. For most usecases, this should work. Lets say you only have 1 project, with tens of developers and a few CI tasks, then this setup should be more than enough.

From Source

# make sure that JAVA_HOME is set. (please use jdk8)
git clone
cd buck-http-cache
./ development 

From Distribution

# make sure that JAVA_HOME is set. (please use jdk8)
./bin/cache server config/development.yml

Cluster mode

If you have many users, projects that will use the cache, then chances are that standalone mode won't work for you. In this case you will need to setup a distributed cache. Lets say you want to deploy the cache to three machines (IP1, IP2, IP3). Update config file standalone.yml and add the following.

multicastPort: 6734
  - <IP1>
  - <IP2>
  - <IP3>

Now you are ready to start the cache in all three hosts. The data will be equally distributed across all three nodes, and you can query any node to fetch the data. Each node acts as a broker and as a in-memory data base. We will enable zookeeper based node discovery soon. At which point we won't have to manually add IPs to the config. Just pointing to a common zk cluster should do the trick.


The cache server by default runs on port 6457. Under the hood it uses Apache Ignite as the cache data grid. In order to use this http cache in your project, add the following to your buckconfig:

  mode = http
  http_url = http://your-server-address:6457
  http_mode = readwrite

This is the most basic way of starting the cache locally. For additional options, see buckconfig. This works in standlone mode. If you are running the cache in cluster mode, then you may want to setup a loadbalancer in front of the nodes.

As an alternative, if you use Okbuck to build your gradle project with buck, you can modify buckw to randomly choose a server on every invocation

CACHE_SERVER=$[ (( $RANDOM % 3 )) + 1 ]
EXTRA_BUCK_CONFIG="--config cache.http_url=http://${CACHE_URL}"