Build the roadrunner binary

First you need to build your roadrunner instance with the cache dependency. You should use velox for that.

Define a configuration.toml file to tell velox what and how it must build.

build_args = ['-trimpath', '-ldflags', '-s -X${VERSION} -X${TIME}']

ref = "master"

    token = "GH_TOKEN"

    logger = { ref = "master", owner = "roadrunner-server", repository = "logger" }
    cache = { ref = "master", owner = "darkweak", repository = "souin", folder = "/plugins/roadrunner" }
	# others ...

level = "debug"
mode = "development"


You can set each Souin configuration key under the http.cache key. There is a configuration example below.

  # /somewhere/.rr.yaml
  # Other http sub keys
      stale: 1000s
        backend: 10s
        cache: 20ms
      ttl: 1000s
      default_cache_control: no-store
    log_level: INFO
    - cache
    # Other middlewares

Look at the configuration section to discover all configurable keys here.

With that your application will be able to cache the responses if possible and returns at least the Cache-Status HTTP header with the different directives mentionned in the RFC specification.

Other resources

You can find an example for a docker-compose stack inside the examples folder on the Github repository.