diff --git a/website/docs/advanced/proxy/overview.mdx b/website/docs/advanced/proxy/overview.mdx index 37c6575e..2843040f 100644 --- a/website/docs/advanced/proxy/overview.mdx +++ b/website/docs/advanced/proxy/overview.mdx @@ -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 /options.yml:/etc/configcat/proxy/options.yml + -v /options.yml:/etc/configcat/proxy/options.yml \ + configcat/proxy ``` (Optional) With the `-c` argument to specify a custom path for your options YAML file: @@ -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, Redis, MongoDB, and DynamoDB 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, Redis, MongoDB, DynamoDB, 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). @@ -2260,6 +2262,125 @@ CONFIGCAT_CACHE_DYNAMODB_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 /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" +``` +::: + + + + +This is the whole YAML section of the file-based cache specific options. +```yaml title="options.yml" +cache: + file: + enabled: + folder: "" +``` + + + + +These are the file-based cache specific environment variables. +```shell +CONFIGCAT_CACHE_FILE_ENABLED= +CONFIGCAT_CACHE_FILE_FOLDER="" +``` + + + + +Here's the explanation for each option: + + + + + + + + + + + + + + + + + + +
OptionDefaultDescription
+ + + + +```yaml +cache: + file: + enabled: +``` + + + + +```shell +CONFIGCAT_CACHE_FILE_ENABLED= +``` + + + + +falseTurns caching into files on/off.
+ + + + +```yaml +cache: + file: + folder: "" +``` + + + + +```shell +CONFIGCAT_CACHE_FILE_FOLDER="" +``` + + + + + +The default user cache directory: +
    +
  • Unix: $XDG_CACHE_HOME
  • +
  • Darwin: $HOME/Library/Caches
  • +
  • Windows: %LocalAppData%
  • +
+
The path of the folder for storing the cache files.
+ ## HTTP The following HTTP and HTTP Proxy related options are available: