-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[🐛 Bug]: next/cache
Supports Only Suspense Cache - Is It Intended?
#547
Comments
next/cache
Supports Only Suspense Cachenext/cache
Supports Only Suspense Cache - Is It Intended?
Can you share an example code snippet that results in this problem, please? You can see a deployed demo that uses the suspense cache (aka fetch/data cache) at https://next-cache-demo.eli.cx/ and it works, so i imagine it is related to how the request is being done. This demo is a deployment of https:/james-elicx/next-geolocation-pages/blob/a5d43de1a3d2b6b09375b5544caab0e4bfd94ffc/app/page.tsx. |
Sure! This is the minimum reproducible project. More thing I've discovered is that caching actually works, however it causes problem with supabase client is used together. As per this and this Supabase client provides method to patch their fetch function. If I put log in
The patched fetch of Supabase client seemed not to go on some internal caching behavior. I'm not sure what actually causes a problem. In Vercel deployment, whole caching thing including Supabase fetch works without problem, which makes me more confusing. |
Dig deeper, Supabase patched I think it is not a next-on-pages problem (maybe supabase client's problem?), and it seems to work as expected. In favor of this I'm closing this issue. Additionally, Vercel deployment with |
next-on-pages environment related information
Description
Result of arbitrary
fetch
response used in the codebase - In my case 3rd party API is used - does not seem to be cached in the network.I've been closely examining #419 and find out that
handleSuspenseCacheRequest
handle only the suspense cache (which name also suggests).Nextjs' data caching supports (and deployment on Vercel actually caches it) data from arbitrary API request, however, the scope of the patch is limited to the suspense cache. It is intended, or is there a way to extend the caching behavior?
Reproduction
fetch
to call external APInpx @cloudflare/next-on-pages@1
wrangler pages dev .vercel/output/static/ --compatibility-date 2022-11-30 --compatibility-flags="nodejs_compat"
Patched
fetch
will always make a request to remote without caching becausehandleSuspenseCacheRequest
would not handle the request.Actual deployment also does not seem to cache the request.
Pages Deployment Method
Pages CI (GitHub/GitLab integration)
Pages Deployment ID
No response
Additional Information
No response
Would you like to help?
The text was updated successfully, but these errors were encountered: