POST + Fetch + Caching: Can I add HTTP response headers to prevent response caching? #55369
Unanswered
ljwagerfield
asked this question in
Help
Replies: 1 comment 6 replies
-
Maybe this? https://nextjs.org/docs/app/building-your-application/caching#opting-out |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
Is there an HTTP response header I can set to prevent Next.js's Fetch from caching POST requests?
For those who are unfamiliar with Next.js's Fetch implementation, it currently caches POST requests:
There are several client-side approaches to opt-out of caching.
Background: This is currently causing a few issues with our SDKs, since they're not expecting POST requests to be cached, and if there's an HTTP response header we can set, then we can instantly solve this problem for all our users who are using Next.js.
Beta Was this translation helpful? Give feedback.
All reactions