Caching
hi! 👋
I have my Prisma schema using PostgreSQL and I need to cache some queries in Redis. Has anyone developed a similar process with setCache, getCache, and invalidateCache manually? If so, how did you resolve it?
2 Replies
Hello 👋
Any particular reason to use Redis?
You could also consider using Prisma Accelerate to cache your query results. Prisma Accelerate is optimised to be used with Prisma and would greatly improve your query performance.
https://www.prisma.io/data-platform/accelerate
For redis, I encountered this community maintained package that might be relevant: https://www.npmjs.com/package/prisma-redis-middleware
For those who are interested in using a caching extension with either redis or dragonflydb, check out
https://github.com/yxx4c/prisma-redis-extension
I have incorporated many necessary features to maintain a good caching solution. Suggestions and recommendations are always welcome.
GitHub
GitHub - yxx4c/prisma-redis-extension: Extensive Prisma extension d...
Extensive Prisma extension designed for efficient caching and cache invalidation using Redis and Dragonfly Databases - yxx4c/prisma-redis-extension