Hi! I’m developing a Next.js 15 app, using Upstash Redis for caching and deploying on Vercel with Fluid Compute.
My goal is to cache and dedublicate all Redis GET responses within a single Fluid lambda container, so that any serverless function running in that container can check a shared variable and avoid calling Redis again if the data is already fetched.
I want:
A global in-memory cache inside the Fluid container
Deduplication across concurrent functions in the same container
To only call redis.get() if we haven't already fetched the key
Deduplication and every possible optimization is important to me.
If you’ve done anything similar or have suggestions on best practices, I’d really appreciate the help!