Unverified Commit 6bd8cd7c authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Ensure we set cache-control: no-cache for actions (#53824)

This ensures we don't accidentally allow caching server actions causing unexpected behavior. 
parent 0350e00d
...@@ -287,6 +287,11 @@ export async function handleAction({ ...@@ -287,6 +287,11 @@ export async function handleAction({
req.method === 'POST' req.method === 'POST'
if (isFetchAction || isURLEncodedAction || isMultipartAction) { if (isFetchAction || isURLEncodedAction || isMultipartAction) {
// ensure we avoid caching server actions unexpectedly
res.setHeader(
'Cache-Control',
'no-cache, no-store, max-age=0, must-revalidate'
)
let bound = [] let bound = []
const workerName = 'app' + pathname const workerName = 'app' + pathname
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment