Skip to content

Commit

Permalink
chore: remove defaults for caching parameters (#927)
Browse files Browse the repository at this point in the history
  • Loading branch information
miparnisari authored Jan 9, 2025
1 parent 1eb2c77 commit 9a03caa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ You can configure the OpenFGA server in three ways:

If the same option is configured in multiple ways the command line parameters will take precedence over environment variables, which will take precedence over the configuration file.

The configuration options and their default values are defined in [config-schema.json](https://github.com/openfga/openfga/blob/main/.config-schema.json).
The configuration options and their default values are shown via `openfga run --help`, and defined in [config-schema.json](https://github.com/openfga/openfga/blob/main/.config-schema.json).

## Using a configuration file

Expand Down
20 changes: 10 additions & 10 deletions docs/content/interacting/consistency.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,16 @@ if (date_modified + cache_time_to_live_period > Date.now()) {

<ProductName format={ProductNameFormat.ShortForm}/> caching is disabled by default. When caching is disabled, all queries will have strong consistency regardless of the consistency mode specified. When caching is enabled, the cache will be used for queries with `MINIMIZE_LATENCY` consistency mode.

You can use the following parameters to configure <ProductName format={ProductNameFormat.ShortForm}/>'s cache:

| Name | Description |
|----------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| check-cache-limit | Configures the number of items that will be kept in the in-memory cache used to resolve Check queries (default = 1000) |
| check-query-cache-enabled | Enables in-memory caching of Check subproblems (default = false). For example, if you have a relation `define viewer: owner or editor`, and the query is `Check(user:anne, viewer, doc:1)`, we'll evaluate the `owner` relation and the `editor` relation and cache both results: `(user:anne, viewer, doc:1) -> allowed=true` and `(user:anne, owner, doc:1) -> allowed=true`. |
| check-query-cache-ttl | Specifies the time that items will be kept in the cache of Check subproblems (default = 10s) |
| check-iterator-cache-enabled | Enables in-memory caching of database iterators. Each iterator is the result of a database query, for example, usersets related to a specific object, or objects related to a specific user, up to a certain number of tuples per iterator (default = false) |
| check-iterator-cache-max-results | Configures the number of tuples that will be stored for each database iterator (default = 10000) |
| check-iterator-cache-ttl | Specifies the time that items will be kept in the cache of database iterators (default = 10s) |
You can use the following command line parameters to configure <ProductName format={ProductNameFormat.ShortForm}/>'s cache. To see the default value of each parameter, please run `openfga run --help`.

| Name | Description |
|----------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| check-cache-limit | Configures the number of items that will be kept in the in-memory cache used to resolve Check queries |
| check-query-cache-enabled | Enables in-memory caching of Check subproblems. For example, if you have a relation `define viewer: owner or editor`, and the query is `Check(user:anne, viewer, doc:1)`, we'll evaluate the `owner` relation and the `editor` relation and cache both results: `(user:anne, viewer, doc:1) -> allowed=true` and `(user:anne, owner, doc:1) -> allowed=true`. |
| check-query-cache-ttl | Specifies the time that items will be kept in the cache of Check subproblems |
| check-iterator-cache-enabled | Enables in-memory caching of database iterators. Each iterator is the result of a database query, for example, usersets related to a specific object, or objects related to a specific user, up to a certain number of tuples per iterator |
| check-iterator-cache-max-results | Configures the number of tuples that will be stored for each database iterator |
| check-iterator-cache-ttl | Specifies the time that items will be kept in the cache of database iterators |

Learn how to [configure <ProductName format={ProductNameFormat.ShortForm}/>](../getting-started/setup-openfga/configure-openfga.mdx).

Expand Down

0 comments on commit 9a03caa

Please sign in to comment.