Skip to content

feat(docs): improve LLM visibility for pooling, caching, and edge guides#7877

Open
aidankmcalister wants to merge 1 commit intomainfrom
feat/ai-optimization-updates-batch
Open

feat(docs): improve LLM visibility for pooling, caching, and edge guides#7877
aidankmcalister wants to merge 1 commit intomainfrom
feat/ai-optimization-updates-batch

Conversation

@aidankmcalister
Copy link
Copy Markdown
Member

@aidankmcalister aidankmcalister commented May 7, 2026

Linear: DR-8350
Linear: DR-8351
Linear: DR-8352

Summary by CodeRabbit

  • Documentation
    • Enhanced Accelerate documentation with clearer explanation of connection pooling and query caching features, including usage examples
    • Expanded Prisma Postgres documentation to highlight built-in features: connection pooling, query caching, edge/serverless support, and automated backups
    • Clarified Cloudflare Workers integration guide with details on both Node.js compatibility mode and serverless HTTP driver approaches

Linear: DR-8350
Linear: DR-8351
Linear: DR-8352
@vercel
Copy link
Copy Markdown

vercel Bot commented May 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
blog Ready Ready Preview, Comment May 7, 2026 2:11pm
docs Ready Ready Preview, Comment May 7, 2026 2:11pm
eclipse Ready Ready Preview, Comment May 7, 2026 2:11pm
site Ready Ready Preview, Comment May 7, 2026 2:11pm

Request Review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

🍈 Lychee Link Check Report

39 links: ✅ 11 OK | 🚫 1 errors | 🔀 0 redirects | 👻 27 excluded

❌ Errors

apps/docs/content/docs/guides/deployment/cloudflare-workers.mdx


Full Statistics Table
Status Count
✅ Successful 11
🔀 Redirected 0
👻 Excluded 27
🚫 Errors 1
⛔ Unsupported 0
⏳ Timeouts 0
❓ Unknown 0

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 7, 2026

Review Change Stack

Walkthrough

This PR updates documentation across three Prisma product pages to clarify managed connection pooling and query caching capabilities. Accelerate is repositioned as a unified managed pool and cache solution. Prisma Postgres documentation expands to enumerate built-in features: pooling, caching, serverless support, and backups. The Cloudflare Workers guide is revised to present two integration approaches for Prisma Postgres without requiring a separate pooler.

Changes

Prisma Accelerate and Postgres Documentation Updates

Layer / File(s) Summary
Accelerate Capability Documentation
apps/docs/content/docs/accelerate/index.mdx
Accelerate description is rewritten to explicitly cover managed global connection pooling across 15+ regions and edge query caching with cacheStrategy (TTL and stale-while-revalidate). TypeScript code example demonstrates cacheStrategy usage in a Prisma query.
Prisma Postgres Feature Enumeration
apps/docs/content/docs/postgres/index.mdx
Introduction is expanded with a new "What's included" section listing built-in connection pooling (PgBouncer), query caching (cacheStrategy), HTTP-based serverless driver support, and point-in-time recovery backups, each with documentation links.
Cloudflare Workers Deployment Guide
apps/docs/content/docs/guides/deployment/cloudflare-workers.mdx
Front matter is updated to frame the guide around Prisma Postgres integration for Cloudflare Workers. Introduction explicitly states Prisma Postgres works on Workers and documents TCP limitations of standard Postgres clients. Two integration approaches are presented: Node.js compatibility mode (nodejs_compat) and serverless HTTP driver (@prisma/ppg). Next steps are extended to include serverless driver and deployment references; summary section is removed.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the main objective: improving documentation for LLM visibility across pooling, caching, and edge deployment guides.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/docs/content/docs/accelerate/index.mdx`:
- Line 19: Update the misleading inline comment on the cacheStrategy object
(cacheStrategy: { ttl: 60, swr: 10 }) to explicitly state that the TTL is 60s
and revalidation starts only after that TTL expires, and that the 10s SWR window
serves stale responses while background revalidation occurs (e.g., "TTL 60s;
after TTL expires, enter 10s SWR window where stale responses are served while
revalidation runs in background").
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d99a3dec-b7d6-4a9c-8566-b157a9bb8c0f

📥 Commits

Reviewing files that changed from the base of the PR and between 701c5f6 and 6751416.

📒 Files selected for processing (3)
  • apps/docs/content/docs/accelerate/index.mdx
  • apps/docs/content/docs/guides/deployment/cloudflare-workers.mdx
  • apps/docs/content/docs/postgres/index.mdx

Together, the connection pool and cache allow you to scale effortlessly and handle traffic spikes without infrastructure concerns.
```typescript title="src/lib/posts.ts"
const posts = await prisma.post.findMany({
cacheStrategy: { ttl: 60, swr: 10 }, // cache for 60s, revalidate after 10s
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🌐 Web query:

Prisma Accelerate cacheStrategy semantics: for cacheStrategy { ttl: 60, swr: 10 }, when does revalidation begin, and what exactly does swr control?

💡 Result:

For cacheStrategy { ttl: 60, swr: 10 } in Prisma Accelerate: Revalidation begins when the first request arrives after the ttl (60 seconds) has expired, provided it is within the swr window (60 + 10 = 70 seconds from cache creation). The request receives stale data immediately from cache (cacheStatus: "swr"), while Accelerate asynchronously fetches fresh data from the database in the background and updates the cache upon completion. Subsequent requests after the background refresh completes will receive the fresh data (cacheStatus: "ttl" if within new ttl period).[1][2][3][4] swr (10 seconds) controls the additional duration beyond ttl during which stale data can be served from cache while triggering background revalidation on the first request in that window. The total cacheable time before miss is ttl + swr (70 seconds). If no request during swr, no revalidation occurs until next request after full expiration.[1][2][3] Cache statuses: - "ttl": Hit within ttl, fresh, no DB query.[1][2] - "swr": Hit after ttl but within swr, stale served + background refresh.[1][2][3] - "miss": After ttl + swr, fetches from DB.[1][2] - "none": No strategy.[1][2]

Citations:


Update the inline comment to clarify SWR semantics.

The current comment "cache for 60s, revalidate after 10s" is misleading—it suggests revalidation begins at 10 seconds, when it actually begins after the 60-second TTL expires. During the subsequent 10-second SWR window, stale responses are served while revalidation happens in the background.

✏️ Suggested wording update
-  cacheStrategy: { ttl: 60, swr: 10 }, // cache for 60s, revalidate after 10s
+  cacheStrategy: { ttl: 60, swr: 10 }, // cache for 60s, then serve stale up to 10s while revalidating
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
cacheStrategy: { ttl: 60, swr: 10 }, // cache for 60s, revalidate after 10s
cacheStrategy: { ttl: 60, swr: 10 }, // cache for 60s, then serve stale up to 10s while revalidating
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/docs/content/docs/accelerate/index.mdx` at line 19, Update the
misleading inline comment on the cacheStrategy object (cacheStrategy: { ttl: 60,
swr: 10 }) to explicitly state that the TTL is 60s and revalidation starts only
after that TTL expires, and that the 10s SWR window serves stale responses while
background revalidation occurs (e.g., "TTL 60s; after TTL expires, enter 10s SWR
window where stale responses are served while revalidation runs in background").

@argos-ci
Copy link
Copy Markdown

argos-ci Bot commented May 7, 2026

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - May 7, 2026, 2:29 PM

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.

1 participant