Repository navigation
docs(saas-api): per-plan maximum TTL, clamped, and a 90-day TTL range (LAB-12085) #224
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1a847ec
docs(saas-api): per-plan maximum TTL, clamped, and a 90-day TTL range
27Bslash6 8a49198
docs(saas-api): apply review findings to the plan maximum TTL change
27Bslash6 1f1efab
fix: address coderabbit review — qualify PUT header and fallback, cap…
27Bslash6 fee24db
docs(saas-api): retire the tier rules whose demand changed, gate clam…
27Bslash6 b504a3e
docs(saas-api): one fallback for the clamp, GET-only omit evidence fo…
27Bslash6 f9cd15d
fix: address coderabbit review — fallback response claim, tier cap wo…
27Bslash6 e353461
docs(saas-api): changelog states the full omit rule; Fallback names s…
27Bslash6 1367725
docs(saas-api): renumber this change's requirement ids after those mi…
27Bslash6 437a6a0
Merge remote-tracking branch 'origin/main' into agent/milchick/lab-12…
27Bslash6 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| ### SaaS API — per-plan maximum TTL, clamped; a 90-day TTL range; the applied bound on the `PUT` response | ||
|
|
||
| - [`spec/saas-api.md` § Plan maximum TTL](spec/saas-api.md#plan-maximum-ttl) (new): Free 86,400 s | ||
| (24 hours), Startup 2,592,000 s (30 days), Professional 7,776,000 s (90 days), Enterprise none. | ||
| On a plan with a maximum, a stated TTL above it is stored with the maximum, not rejected, and a | ||
| write without a TTL is stored with the maximum instead of with no expiry | ||
| ([API-97](spec/saas-api.md#api-97)). The maximum bounds `evict_at` from each write's stamp: the | ||
| fresh window is kept first and the stale window gets what is left. `PATCH /ttl` is clamped the | ||
| same way ([API-98](spec/saas-api.md#api-98)), and its response must not extend a local copy | ||
| ([API-104](spec/saas-api.md#api-104)). Validation stays plan-independent, so a client can still | ||
| pre-validate every write. A server that cannot determine the tenant's plan stores the write as | ||
| stated, and so does a deployment that does not yet meet the conditions API-101 sets for | ||
| clamping, so the plan maximum is not a guaranteed ceiling on an entry's lifetime. Entries stored | ||
| before the change keep their timing until their next write or `PATCH`. | ||
| - The TTL range of `X-CacheKit-TTL`, of `PATCH /ttl`'s `ttl` and of `ttl + stale_ttl` rises from | ||
| 2,592,000 to 7,776,000 (`stale_ttl` alone to 7,775,999). A larger value is still a `400`. | ||
| - The plan maximum is the only default for a write without a TTL | ||
| ([API-99](spec/saas-api.md#api-99), which merges and retires API-40 and API-41). | ||
| - A store that clamps sends `X-CacheKit-Fresh-For` on every `PUT` `2xx` for a bounded entry: the | ||
| stored entry's remaining freshness ([API-100](spec/saas-api.md#api-100)). No write or `PATCH` is | ||
| clamped until the store sends it, every server-side hop that relays the `PUT` `2xx` passes it | ||
| through, and every tier that keeps a copy of a forwarded write bounds that copy by it | ||
| ([API-101](spec/saas-api.md#api-101)). An SDK bounds its copy of its own write by | ||
| `min(local_ttl, effective_ttl, fresh_for)` ([API-103](spec/saas-api.md#api-103), replacing API-35). | ||
| A re-serving tier bounds its copy of a forwarded write by the same header | ||
| ([API-105](spec/saas-api.md#api-105), [API-106](spec/saas-api.md#api-106) and | ||
| [API-107](spec/saas-api.md#api-107), replacing API-20, API-21 and API-27) and relays it unraised | ||
| ([API-102](spec/saas-api.md#api-102)). A tier may omit the header only on positive knowledge | ||
| of no expiry: a `GET` `200` from a signal-capable store that omitted it, or a forwarded write | ||
| with no TTL whose `PUT` `2xx` omitted it. | ||
| - The `X-CacheKit-Fresh-For` grammar keeps its 2,592,000 maximum: no server or tier emits a larger | ||
| value, even for an entry with more than 30 days of freshness left. | ||
| - **Breaking for callers on a plan with a maximum TTL:** once the server applies this, a write | ||
| without a TTL is no longer stored with no expiry, and a TTL above the plan's maximum is | ||
| shortened to it. | ||
| - **Breaking for SDKs, in order:** the server takes the 90-day range first; until it does, a TTL | ||
| over 2,592,000 is still a `400`, so an SDK must not widen its own TTL check before that. After it, | ||
| an SDK that refuses a TTL over 2,592,000, or a `ttl + stale_ttl` over it, refuses writes the | ||
| server accepts. An SDK that ignores `X-CacheKit-Fresh-For` on the `PUT` response keeps its copy | ||
| of a clamped write past the stored entry's `fresh_until`. The | ||
| [feature matrix](sdk-feature-matrix.md) records each SDK's state. | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.