Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
125 changes: 123 additions & 2 deletions website/docs/advanced/proxy/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,8 @@ When running the Proxy in docker, you can mount the options YAML file as a volum
docker run -d --name configcat-proxy \
-p 8050:8050 -p 8051:8051 -p 50051:50051 \
// highlight-next-line
-v <path-to-file>/options.yml:/etc/configcat/proxy/options.yml
-v <path-to-file>/options.yml:/etc/configcat/proxy/options.yml \
configcat/proxy
```

(Optional) With the `-c` argument to specify a custom path for your options YAML file:
Expand Down Expand Up @@ -1527,7 +1528,8 @@ When an SDK also has its offline option set, that will override what it would in

The Proxy in its default setup stores all the information it needs for feature flag evaluation in memory. This behavior is extendable with an external cache that you can use for pointing the underlying SDKs to your own data storage.

Currently, <a target="_blank" href="https://redis.io">Redis</a>, <a target="_blank" href="https://mongodb.com/">MongoDB</a>, and <a target="_blank" href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide">DynamoDB</a> is supported as external cache. The cache key for the underlying SDKs is based on the [SDK Key](#sdk-identifier--sdk-key). This means that multiple Proxy instances using the same SDK key will read/write the same cache entry.
Currently, <a target="_blank" href="https://redis.io">Redis</a>, <a target="_blank" href="https://mongodb.com/">MongoDB</a>, <a target="_blank" href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide">DynamoDB</a>, and file-based caching are supported as external caches.
The cache key for the underlying SDKs is based on the [SDK Key](#sdk-identifier--sdk-key). This means that multiple Proxy instances using the same SDK key will read/write the same cache entry.

:::info
The ConfigCat Proxy supports *shared caching*, which means it can feed an external cache that is shared by other ConfigCat SDKs. You can read more about this feature and the required minimum SDK versions [here](../caching.mdx#shared-cache).
Expand Down Expand Up @@ -2260,6 +2262,125 @@ CONFIGCAT_CACHE_DYNAMODB_TABLE="<table-name>"
</tbody>
</table>

### File

When enabled without specifying a folder, the Proxy will use the platform-specific default user cache directory for storing the cache files.

:::info
When specifying a cache folder, it's important to ensure that the user which runs the Proxy has the necessary read and write permissions for that folder.

For example, if you want to use a docker volume, you can mount it to the `nonroot` user's home directory like this:
```shell
docker run -d --name configcat-proxy \
-p 8050:8050 -p 8051:8051 -p 50051:50051 \
-v <path-to-file>/options.yml:/etc/configcat/proxy/options.yml \
// highlight-next-line
-v filecache:/home/nonroot \
configcat/proxy
```

And respectively, set the `folder` option in the `options.yml` file to point to the mounted cache directory:
```yaml
cache:
file:
enabled: true
folder: "/home/nonroot"
```
:::

<Tabs groupId="yaml-env">
<TabItem value="yaml" label="YAML" default>

This is the whole YAML section of the file-based cache specific options.
```yaml title="options.yml"
cache:
file:
enabled: <true|false>
folder: "<folder-path>"
```

</TabItem>
<TabItem value="env-vars" label="Environment variables">

These are the file-based cache specific environment variables.
```shell
CONFIGCAT_CACHE_FILE_ENABLED=<true|false>
CONFIGCAT_CACHE_FILE_FOLDER="<folder-path>"
```

</TabItem>
</Tabs>

Here's the explanation for each option:

<table className="proxy-arg-table">
<thead><tr><th>Option</th><th>Default</th><th>Description</th></tr></thead>
<tbody>

<tr>
<td>

<Tabs groupId="yaml-env">
<TabItem value="yaml" label="YAML" default>

```yaml
cache:
file:
enabled: <true|false>
```

</TabItem>
<TabItem value="env-vars" label="Environment variable">

```shell
CONFIGCAT_CACHE_FILE_ENABLED=<true|false>
```

</TabItem>
</Tabs>

</td>
<td><code>false</code></td>
<td>Turns caching into files on/off.</td>
</tr>

<tr>
<td>

<Tabs groupId="yaml-env">
<TabItem value="yaml" label="YAML" default>

```yaml
cache:
file:
folder: "<folder-path>"
```

</TabItem>
<TabItem value="env-vars" label="Environment variable">

```shell
CONFIGCAT_CACHE_FILE_FOLDER="<folder-path>"
```

</TabItem>
</Tabs>

</td>
<td>
The default user cache directory:
<ul>
<li>Unix: <code>$XDG_CACHE_HOME</code></li>
<li>Darwin: <code>$HOME/Library/Caches</code></li>
<li>Windows: <code>%LocalAppData%</code></li>
</ul>
</td>
<td>The path of the folder for storing the cache files.</td>
</tr>

</tbody>
</table>

## HTTP

The following HTTP and HTTP Proxy related options are available:
Expand Down
Loading