1// getShare>0.20 filter WHY: a route that's >80% POST/PUT/DELETE is a mutation endpoint2// where 0% cache is correct — recommending caching there is wrong.3// cache_result values STALE/REVALIDATED/BYPASS fold into "total but not HIT" — matches the "uncached" framing.45import { withRouteShapeWarnings } from '../route-normalize.mjs';67const MIN_GET_SHARE = 0.20;89/** @type {import('./types.d.ts').GateMetadata} */10export const metadata = {11 id:
17 'Routes serving > 500 requests/period at < 50% cache hit AND at least 20% GET traffic. Each uncached GET request reaches the function, costing edge requests + function duration. Routes that are mostly POST/PUT/DELETE (Server Actions, mutations) are skipped — 0% cache is correct behavior there. Routes with missing method-share data are gated instead of launched. Auth-gated routes are disqualified separately.',
41 question: `Why does ${r.route} have ${(r.hitRate * 100).toFixed(0)}% cache hit rate on ${r.requests} requests in this metrics window, and is it safe to cache at the edge?`,