import { probeNow, toolsCache } from "@/lib/doctor"; export const dynamic = "force-dynamic"; // GET is the cache, and only the cache: `{ checked: false }` when nothing has // been probed in the last ten minutes. POST probes. The split is the rule that // the index and the pages never shell out -- a probe is an action somebody took. export async function GET() { const c = toolsCache(); return Response.json( c ? { checked: true, ...c } : { checked: false }, { headers: { "cache-control": "no-store" } }, ); } export async function POST() { const r = await probeNow(); return Response.json({ checked: true, ...r }, { headers: { "cache-control": "no-store" } }); }