1// Two checks emitted as `missing-cache-headers`:2// A. GET handler with no Cache-Control AND no auth signal.3// B. fetch() with `cache:'no-store'` / `next:{revalidate:0}` outside an4// auth window (~10 lines above, 5 below).56export const metadata = {7 id: 'missing-cache-headers',8 title: 'Cacheable route or fetch with no caching (Cache-Control absent or no-store)',9 severity: 'medium',10 billingDimension: 'edge-requests',11 trafficIndependent:
13 'Two antipatterns: (a) GET handlers without explicit Cache-Control headers serve uncached; (b) fetch() calls with cache:"no-store" or next:{revalidate:0} opt out of caching even on cacheable upstream data. For non-auth routes / fetches, both are leaving cache hits on the floor.',
14 fix:
15 'For GET handlers: return a Response with Cache-Control: public, s-maxage=<seconds>, stale-while-revalidate=<window>. For fetch(): drop cache:"no-store" (use { next: { revalidate: <seconds> } } in Next.js) so the response is cached by the framework + CDN.',