NextJs Supabase SSR rate limit with cache wrapper...
Hey everyone
,
I've been working with Supabase in my Next.js projects and ran into an issue with constant refetching, leading to rate limits (HTTP 429). I'm using the @supabase/ssr package, and my goal is to reduce the number of requests by caching the authenticated user data.
I've implemented a cached function in Next.js to get the authenticated user data like this:
However, despite caching, I'm still facing constant refetching and subsequent rate-limiting issues. How can I optimize this to bypass the constant refetching and prevent rate limits?
I'd appreciate any insights or suggestions on how to handle this more efficiently. Thanks in advance!
I've been working with Supabase in my Next.js projects and ran into an issue with constant refetching, leading to rate limits (HTTP 429). I'm using the @supabase/ssr package, and my goal is to reduce the number of requests by caching the authenticated user data.
I've implemented a cached function in Next.js to get the authenticated user data like this:
However, despite caching, I'm still facing constant refetching and subsequent rate-limiting issues. How can I optimize this to bypass the constant refetching and prevent rate limits?
I'd appreciate any insights or suggestions on how to handle this more efficiently. Thanks in advance!