Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: improve docs on caching #886

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

docs: improve docs on caching #886

wants to merge 6 commits into from

Conversation

miparnisari
Copy link
Member

No description provided.

Copy link
Contributor

github-actions bot commented Nov 8, 2024

PR Preview Action v1.4.7
🚀 Deployed preview to https://openfga.github.io/openfga.dev/pr-preview/pr-886/
on branch gh-pages at 2024-11-16 01:59 UTC

@@ -29,7 +29,7 @@ The following list outlines best practices for running OpenFGA in a production e

We recommend:

1. Turn on caching via the flag `--check-query-cache-enabled`. This will reduce latency of requests, but it will increase the staleness of OpenFGA's responses. (The TTL is configurable).
1. Turn on caching in Check API via flags. This will reduce latency of requests, but it will increase the staleness of OpenFGA's responses. Please see [Cache Expiration](../interacting/consistency.mdx#cache-expiration) for details on the flags.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which flags? That should be mentioned here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I mention the link where the flags are explained 🤔

@@ -19,7 +19,8 @@ import {
The following list outlines some guidelines and best practices for using <ProductName format={ProductNameFormat.ShortForm}/>:

- Do not store Personal Identifiable Information in tuples
- Always specify authorization model ID whenever possible
- Always specify authorization model ID in requests
- Specify the desired consistency in requests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we link "consistency" to the relevant part in the doc? I would imagine people might not know what that is.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bullet list is the titles of the sections below. I added the link to what consistency is down below 👍


It is strongly recommended that authorization model ID be specified in your Relationship Queries (such as [Check](./perform-check.mdx) and [ListObjects](../interacting/relationship-queries.mdx#listobjects)) and Relationship Commands (such as [Write](./update-tuples.mdx)).

Specifying authorization model ID in API calls have the following advantages:
1. Better performance as <ProductName format={ProductNameFormat.ShortForm}/> will not need to perform a database query to get the latest authorization model ID.
2. Allows consistent behavior in your production system until you are ready to switch to the new model.

## Specify the desired consistency in requests

It is strongly recommended that you specify the `Consistency` value in each individual request, depending on whether you prefer speed (MINIMIZE_LATENCY) or correctness (MAXIMIZE_CONSISTENCY). The default is MINIMIZE_LATENCY.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good summary but again, is there a consistency section we can link to?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants