-
Notifications
You must be signed in to change notification settings - Fork 6
[ML-896] docs: align docs with implementation #72
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -121,20 +121,20 @@ See [CACHING.md](CACHING.md#stampede-protection) for details. | |||||
|
|
||||||
| - **Type:** Boolean | ||||||
| - **Default:** `false` | ||||||
| - **Description:** Enable stale-while-revalidate caching pattern | ||||||
| - **Description:** Advisory SWR intent flag (effective SWR behavior is controlled by `cache_stale_ttl`) | ||||||
|
|
||||||
| ```ruby | ||||||
| config.cache_stale_while_revalidate = true # Enable SWR | ||||||
| config.cache_stale_while_revalidate = true # Optional intent flag | ||||||
| ``` | ||||||
|
|
||||||
| When enabled, serves stale cached data immediately while refreshing in the background. This dramatically reduces P99 latency by avoiding synchronous API waits after cache expiration. | ||||||
| This flag does not independently turn SWR on/off in runtime cache behavior. SWR is active when `cache_stale_ttl > 0`. | ||||||
|
|
||||||
|
Comment on lines
+124
to
131
|
||||||
| **Behavior:** | ||||||
|
|
||||||
| - `false` (default): Cache expires at TTL, next request waits for API (~100ms) | ||||||
| - `true`: After TTL, serves stale data instantly (~1ms) + refreshes in background | ||||||
| - `cache_stale_ttl <= 0` (default): Cache expires at TTL, next request waits for API (~100ms) | ||||||
|
||||||
| - `cache_stale_ttl <= 0` (default): Cache expires at TTL, next request waits for API (~100ms) | |
| - `cache_stale_ttl == 0` (default): Cache expires at TTL, next request waits for API (~100ms) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Client#update_promptcan raiseArgumentErrorwhenlabelsis not an Array (enforced inApiClient#update_prompt). Please document this in the Raises section so callers know what to expect for invalid inputs.