Replies: 2 comments 5 replies
-
Hello @ScreamZ!
Thank you so much! You've asked a lot of good question. Let me answer them one by one. Upstash Redis clientFirstly, thank you for your effort in creating a Handler for You can use more robust Connecting to Upstash Redis with import { createClient } from "redis"
const client = createClient ({
url : "rediss://default:password@hostname:port"
}); |
Beta Was this translation helpful? Give feedback.
-
@ScreamZ, hi there! I made sure to address all your inquiries and set up a Wiki page for those who want to delve into the internal workings of Next.js. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm interested in that library, I would like to say a good job and thank you as the first word.
I've been migrating from Vercel to a custom barebone solution, and as I'm using Upstash Redis https://upstash.com/ I change my code a bit to use their SDK.
I've written the driver based on the Redis-string one.
I'll share a draft here, It still needs some changes to be customizable on instantiation. However, I have some questions.
Note
Click below for my Upstash Redis driver.
➡️ My Upstash Redis Custom Driver (click)
Questions
NextJS cache documentation is currently very opaque, and the documentation is being redirected to your library. Which is nice. Maybe you've some other resources to help me understand the core feature, without the addition of Next-cache ?
To stimulate community members like me to contribute, it could be nice to explain things upstream so we can make clear decisions. That's why I need some precision about some things.
➡️ What is
implicit tags
? What is it supposed to be ?Are they those generated automatically by NestJS for routing cache? Do they include tags from fetch tags or unstable__cache tags ?
➡️ About
NEXT_CACHE_IMPLICIT_TAG_ID: "_N_T_"
Currently, you've scoped it to the next-cache package, but it exists inside nextjs package (somewhere nester in a dist folder). My question is what is that about, is it considered stable and public API?
Why does it need a different treatment from other cache
keys
?➡️ about
get
andrevalidateTag
I'm not sure why this is required to revalidate on the next
get
operation? Generally speaking I would be pleased if there were more information about what are elements from the code (like implicit tags) with examples and why are things done like they were.➡️ Side question
What's the most simple way to handle two cache? For some keys, I would like to handle it with LRU not redis. I guess my best bet is to put LRU first and throw if the key is not found in
get
and in theset
method throw if tags are not matching my requirements, so redis would handle it ?Thank you for answering this first batch of questions and for your work, and I would be pleased to contribute if I can manage to understand the logic of all of this.
Beta Was this translation helpful? Give feedback.
All reactions