fix(server): no-store Cache-Control on hub HTML pages
Browsers were caching /board and /team, so a stale page kept showing old markup and didn't reflect live task/agent state (looked like the pre-redesign team page + tasks appearing unclaimed though the server had them claimed). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
7ca6c859f2
commit
8dbbd0d10c
@ -36,6 +36,16 @@ function wantsHtml(request: { headers: { accept?: string } }): boolean {
|
||||
}
|
||||
|
||||
export async function registerRoutes(app: FastifyInstance, cwd: string): Promise<void> {
|
||||
// Never let a browser cache a hub HTML page — otherwise a stale board/team
|
||||
// page keeps showing old markup and doesn't reflect live task/agent state.
|
||||
app.addHook('onSend', async (_request, reply, payload) => {
|
||||
const ct = reply.getHeader('content-type');
|
||||
if (typeof ct === 'string' && ct.includes('text/html')) {
|
||||
reply.header('Cache-Control', 'no-store, must-revalidate');
|
||||
}
|
||||
return payload;
|
||||
});
|
||||
|
||||
// Static, self-contained Trello-like board. Polls /tasks, /handoffs and
|
||||
// /decisions on the same origin; no build step, no deps. Cached once — the
|
||||
// markup is constant, only the data it fetches changes.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user