Blog refresh: query caching post reframed to Prisma Postgres built-in caching#8051
Blog refresh: query caching post reframed to Prisma Postgres built-in caching#8051vanrensbird wants to merge 1 commit into
Conversation
… caching Reviewed by Martin on localhost and passed Step 10 adversarial review. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughThis PR rewrites a blog post's frontmatter and body content, retargeting it from Prisma Accelerate caching to Prisma Postgres per-query caching via cacheStrategy. Sections on TTL/SWR, when to cache, and savings are rewritten; a new FAQ section replaces prior Accelerate-specific content, and the closing note references Prisma Next. ChangesBlog content update
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
apps/blog/content/blog/caching-database-queries-with-prisma-accelerate/index.mdx (1)
51-51: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueMinor: tighten "at the moment" for conciseness.
Static analysis flags "at the moment the data expires" as wordy. A tighter phrasing improves readability without losing meaning.
✏️ Suggested rewording
- `swr` (stale-while-revalidate) serves the stale result for an additional window while the cache refreshes in the background, so users get fast responses even at the moment the data expires. + `swr` (stale-while-revalidate) serves the stale result for an additional window while the cache refreshes in the background, so users get fast responses even when the data expires.🤖 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/blog/content/blog/caching-database-queries-with-prisma-accelerate/index.mdx` at line 51, Tighten the wording in the paragraph about ttl and swr by rephrasing the sentence in the blog post content near the caching explanation, especially the phrase “at the moment the data expires,” to a more concise equivalent while keeping the meaning the same.Source: Linters/SAST tools
🤖 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/blog/content/blog/caching-database-queries-with-prisma-accelerate/index.mdx`:
- Line 93: The Prisma Postgres provisioning command in the blog content is
outdated; update the sentence in the markdown so it tells readers to use the
current `npx create-db@latest` command instead of `npx create-db`. Keep the rest
of the guidance unchanged and make sure the command reference in the caching
article is consistent with the latest Prisma Postgres setup flow.
---
Nitpick comments:
In
`@apps/blog/content/blog/caching-database-queries-with-prisma-accelerate/index.mdx`:
- Line 51: Tighten the wording in the paragraph about ttl and swr by rephrasing
the sentence in the blog post content near the caching explanation, especially
the phrase “at the moment the data expires,” to a more concise equivalent while
keeping the meaning the same.
🪄 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: ab0f902f-e698-46da-964e-39d31c04c6ca
📒 Files selected for processing (1)
apps/blog/content/blog/caching-database-queries-with-prisma-accelerate/index.mdx
| Caching remains one of the genuinely hard problems of software engineering. Caching more things won't solve problems by itself; a team needs to understand what can be cached and how it impacts their product. | ||
|
|
||
| While there are many different approaches to caching, Prisma Accelerate makes it easy to implement caching on a pre-query basis and gives you more time to focus on building great products. If you’d like to take the next step, [learn more about Accelerate](https://www.prisma.io/data-platform/accelerate?utm_source=website&utm_medium=blogpost&utm_campaign=caching) and [get started](https://www.prisma.io/docs/accelerate/getting-started) caching your Prisma ORM queries today. | ||
| With caching built into [Prisma Postgres](https://www.prisma.io/docs/postgres/database/caching) on a per-query basis, the implementation part stops being the hard part, and you can spend the time on the decisions instead. Create a database with `npx create-db`, add a `cacheStrategy` to your hottest query, and measure the difference. |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Search the repo for references to create-db to confirm the correct invocation.
rg -nP '\bcreate-db\b' --type=md --type=mdx -C2 || rg -nP 'create-db' -g '*.md' -g '*.mdx' -C2Repository: prisma/web
Length of output: 176
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Search tracked files for the command and related Prisma Postgres phrasing.
git ls-files | grep -E '\.(md|mdx|markdown|txt|yml|yaml|json)$' | xargs -r rg -n -C2 'create-db|Prisma Postgres|create a database|npx `@prisma`|`@prisma/create-db`|prisma create-db'Repository: prisma/web
Length of output: 50369
🌐 Web query:
Prisma Postgres create database command npx create-db current command
💡 Result:
The command to provision a temporary Prisma Postgres database is npx create-db@latest [1][2]. This tool is a standalone CLI utility designed to quickly create managed PostgreSQL databases for testing or prototyping [2][3]. By default, databases created with this command are temporary and will be automatically deleted after 24 hours unless claimed using the URL provided in the terminal output [2][3]. Common Usage Commands: - Default creation: npx create-db@latest [2][4] - Interactive mode (to select a region): npx create-db@latest --interactive (or -i) [2][4] - Specify a region: npx create-db@latest --region (or -r) [2][4] - Alias commands: You can also use npx create-pg@latest or npx create-postgres@latest [4][3]. For configuration, you can use the --env flag to output the connection string directly, for example: npx create-db@latest --env >>.env [4]. Note that this is distinct from the prisma init --db command, which is used to initialize a new Prisma project configured with a managed Prisma Postgres database on the Prisma Data Platform [5].
Citations:
- 1: https://www.prisma.io/docs/postgres/npx-create-db
- 2: https://www.prisma.io/docs/v6/postgres/introduction/npx-create-db
- 3: https://github.com/prisma/docs/blob/main/apps/docs/content/docs.v6/orm/reference/prisma-cli-reference.mdx
- 4: https://github.com/prisma/create-db/blob/main/README.md
- 5: https://www.prisma.io/docs/cli/init
Use npx create-db@latest here. The current Prisma Postgres provisioning command includes @latest; npx create-db is stale and will mislead readers.
🤖 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/blog/content/blog/caching-database-queries-with-prisma-accelerate/index.mdx`
at line 93, The Prisma Postgres provisioning command in the blog content is
outdated; update the sentence in the markdown so it tells readers to use the
current `npx create-db@latest` command instead of `npx create-db`. Keep the rest
of the guidance unchanged and make sure the command reference in the caching
article is consistent with the latest Prisma Postgres setup flow.
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
Reframes the 2024 Accelerate caching post to Prisma Postgres's built-in TTL/SWR caching (verified included in Prisma Postgres). Same per-query
cacheStrategyAPI; Accelerate marketing CTAs, speed-test link, and Prisma Optimize link removed; client-extension enablement step stated; egress-free note corrected. FAQ accordions, answer-first lead.🤖 Generated with Claude Code
Summary by CodeRabbit
ttlandswrcaching behavior.