What is Otter

Otter is a high performance lockless cache for Go. Many times faster than Ristretto and friends.

Github repository

https://github.com/maypok86/otter

Use Otter

With Caddy

You have to build your caddy instance including Souin and Otter using xcaddy (refer to the build caddy section).

  xcaddy build --with github.com/darkweak/souin/plugins/caddy --with github.com/darkweak/storages/otter/caddy
  

You will be able to use otter in your Caddyfile or JSON configuration file.

  {
    cache {
        ttl 1h
        otter
    }
}

route {
    cache
    respond "Hello HTTP cache"
}
  

Configuration

You can find the configuration for Otter with the values table below.
By default the cache size is for 10_000 elements.

Values

Key nametyperequired
sizeint