diff --git a/src/server/routes.ts b/src/server/routes.ts index 99b370d..91778eb 100644 --- a/src/server/routes.ts +++ b/src/server/routes.ts @@ -36,6 +36,16 @@ function wantsHtml(request: { headers: { accept?: string } }): boolean { } export async function registerRoutes(app: FastifyInstance, cwd: string): Promise { + // 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.