feat(fastify): first-class tricache/fastify package entry - #8
dyk1454683243-sudo wants to merge 1 commit into
Conversation
Re-export the existing Fastify plugin from src/http/fastify so apps can import createFastifyPlugin, fastifyCachePlugin, and fastifyCache from tricache/fastify. tricache/http Fastify exports stay for back-compat. Fixes #7 Co-authored-by: David <dyk1454683243-sudo@users.noreply.github.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7bfbb44995
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| |---|---|---|---| | ||
| | `cache` | `CacheService` | singleton | TriCache instance. If omitted, lazily resolves `CacheService.create()` | | ||
| | `ttl` | `number` | `300` | Time-to-live in seconds | | ||
| | `swr` | `number` | `undefined` | Stale-While-Revalidate window in seconds | |
There was a problem hiding this comment.
Remove or implement the advertised
swr option
When a user configures swr, the Fastify implementation ignores it: both response-capture paths call activeCache.set(...), which only stores the normal TTL and tags, rather than using CacheService.get(..., { swr }) or otherwise retaining a stale window. Consequently an entry expires after ttl and becomes a normal miss instead of being served stale and revalidated, so this newly documented option gives users behavior different from what the table promises.
Useful? React with 👍 / 👎.
Opened against this fork by mistake. The upstream PR is Kareem411#46 (Fixes #7). Closing this one.