Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: explicit
cache: no-store
in fetch (#847)
Next.js polyfills the `fetch` on the server side to always cache (what's known as their Data Cache) responses. Quote: > Next.js has a built-in Data Cache that persists the result of data fetches across incoming server requests and deployments. This is possible because Next.js extends the native fetch API to allow each request on the server to set its own persistent caching semantics. > > Good to know: In the browser, the cache option of fetch indicates how a request will interact with the browser's HTTP cache, in Next.js, the cache option indicates how a server-side request will interact with the server's Data Cache. This is _incredibly dangerous_ for Auth use cases. Thankfully, it appears that using the default client uses `@supabase/node-fetch` in such a circumstance which should not be affected by the issue. However, if developers do choose to switch back to the native `fetch` in Next.js the library must inform that HTTP client that there should be no caching under any circumstance on Auth responses. Opting out docs: https://nextjs.org/docs/app/building-your-application/caching#opting-out-1
- Loading branch information
034bee0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cache: 'no-store'
breaksauth-js
in cloudflare workers because it is not supported