#Best way to use Redis
13 messages · Page 1 of 1 (latest)
Hi @summer thunder. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
I'm sorry, but the knowledge sources do not contain information about integrating Redis with a Next.js app that uses Convex as its database. Convex is designed to handle backend infrastructure, including caching and reactivity, so you typically do not need to add a separate caching layer like Redis when using Convex. Convex provides automatic caching and real-time updates out of the box, which eliminates many of the traditional reasons for using Redis alongside a database in web applications The Zen of Convex Convex vs. Relational Databases.
If you have a specific use case that requires Redis, the knowledge sources do not provide guidance or best practices for integrating it with Convex and Next.js.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@summer thunder Kapa.ai is still learning and improving, please let me know how I did by reacting below.
@rich nebula The image should be more of a thumbnail to the tweet rather than explaining it.
Let me check the knowledge base for you again. One moment! :books:
I'm sorry, but the knowledge sources do not contain information about generating or displaying tweet thumbnails specifically, nor do they provide guidance on how to create an image that serves as a thumbnail rather than an explanation of a tweet. If you are looking to generate or display images (such as thumbnails) in Convex, there are examples of generating images with OpenAI's DALL-E and storing them in Convex, as well as serving those images to clients by generating URLs from storage IDs Using Dall-E from Convex Serving the image to the client.
However, there is no specific information about creating tweet thumbnails or best practices for making an image "more of a thumbnail" in the context of Convex. If you need to generate a thumbnail, you might consider resizing or cropping the image after generation, but the knowledge sources do not provide details on this process.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@summer thunder Kapa.ai is still learning and improving, please let me know how I did by reacting below.
@rich nebula Sorry wrong thing, here's what I wanted to say: So then why does convex load slow still? Is there a way I have to enable specific caching?
Let me check the knowledge base for you again. One moment! :books:
Convex provides automatic caching for query functions—meaning you do not need to manually enable or configure caching for standard queries. When you use Convex queries, the results are cached and only recomputed when the underlying data changes. This is designed to keep your app fast and consistent without extra work from you Realtime The platform you need, when you need it.
However, if your app still feels slow, there could be other factors at play:
- Network Latency: All Convex servers currently run in the US. If your users are far from this region (e.g., in Australia or Asia), you may experience higher round-trip times. Multi-region support and edge caching are planned for the future, but not available yet How does convex provide for multi region?.
- Query Design: Ensure your queries are efficient and use indexes where appropriate. Inefficient queries or missing indexes can slow down response times The Zen of Convex.
- Client-Side Experience: If you want instant reloads when navigating between pages, you can use the Convex Query Cache Helper (
ConvexQueryCacheProvider) to keep query subscriptions alive even when components unmount. This can improve perceived speed by avoiding unnecessary loading states, but it may increase bandwidth usage since subscriptions remain active in the background Optimise Fetching data Caching system failure.
In summary, you do not need to enable caching manually, but for the best experience:
- Optimize your queries and use indexes.
- Consider using the query cache helper for instant reloads between views.
- Be aware of geographic latency if your users are far from the US.
If you are still experiencing slowness, it may be due to one of these factors rather than caching configuration.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@summer thunder Kapa.ai is still learning and improving, please let me know how I did by reacting below.