Prisma Accelerate is a global database cache and connection pooler for Prisma.
Setup
import { PrismaClient } from "@prisma/client/edge";
import { withAccelerate } from "@prisma/extension-accelerate";
const prisma = new PrismaClient().$extends(withAccelerate());
Cached Queries
const users = await prisma.user.findMany({ cacheStrategy: { ttl: 60 } });
const posts = await prisma.post.findMany({ cacheStrategy: { ttl: 60, swr: 120 } });
Key Features
- Edge caching with TTL/SWR
- Connection pooling for serverless
- Global edge network
- Free tier available
Need to scrape or monitor web data at scale? Check out my web scraping actors on Apify or email spinov001@gmail.com for custom solutions.
Top comments (0)