Skip to content

Commit 5b667d7

Browse files
authored
fix(api): prevent caching authenticated workflow variables (#8339)
1 parent e625a4c commit 5b667d7

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

  • apps/sim/app/api/workflows/[id]/variables

‎apps/sim/app/api/workflows/[id]/variables/route.ts‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,18 +153,12 @@ export const GET = withRouteHandler(
153153
}
154154
}
155155

156-
// Add cache headers to prevent frequent reloading
157-
const variableHash = JSON.stringify(variables).length
158-
const headers = new Headers({
159-
'Cache-Control': 'max-age=30, stale-while-revalidate=300', // Cache for 30 seconds, stale for 5 min
160-
ETag: `"variables-${workflowId}-${variableHash}"`,
161-
})
162-
163156
return NextResponse.json(
164157
{ data: variables },
165158
{
166159
status: 200,
167-
headers,
160+
// Cookie-authenticated variables must not be stored or reused by HTTP caches.
161+
headers: { 'Cache-Control': 'private, no-store' },
168162
}
169163
)
170164
} catch (error) {

0 commit comments

Comments
 (0)