Pre-launch — Gluecron is in final validation. Public signups and git hosting for non-owner users open after launch review.
CodeIssuesDiscussionsWikiPull RequestsProjectsCommitsActionsReleasesContributorsPulse● GatesSecuritySettingsDeploymentsPipelineInsightsAgents✨ Explain✨ Ask AI✨ Workspace✨ Spec✨ Tests▓ Debt Map✨ NL Search🏛 Archaeology
Blame · Line-by-line history

no-cache.ts

Each line is annotated with the commit that last touched it. Click any SHA to jump to that commit and see the surrounding change.

no-cache.tsBlame14 lines · 1 contributor
f5b9ef5Claude1import type { MiddlewareHandler } from "hono";
2
3// Applied to HTML routes that must never be served stale.
4// CSS/JS/git pack files are NOT affected by this middleware.
5export const noCache: MiddlewareHandler = async (c, next) => {
6 await next();
7 const ct = c.res.headers.get("Content-Type") || "";
8 // Only add no-cache to HTML responses — don't break asset caching
9 if (ct.includes("text/html")) {
10 c.res.headers.set("Cache-Control", "no-store, no-cache, must-revalidate");
11 c.res.headers.set("Pragma", "no-cache");
12 c.res.headers.set("Vary", "Cookie");
13 }
14};