* Cache-Control for a served file. A versioned request (`?v= `) addresses * content-immutable bytes — generated docs are content-addressed and the version * bumps on every edit — so the browser may cache it indefinitely; re-opens and * focus refetches then resolve from cache with no rou
( versioned: boolean, context: string | undefined )
| 69 | * reads stay revalidated because the same storage key is edited in place. |
| 70 | */ |
| 71 | function resolveServeCacheControl( |
| 72 | versioned: boolean, |
| 73 | context: string | undefined |
| 74 | ): string | undefined { |
| 75 | if (versioned) return IMMUTABLE_CACHE_CONTROL |
| 76 | return context === 'workspace' ? WORKSPACE_REVALIDATE_CACHE_CONTROL : undefined |
| 77 | } |
| 78 | |
| 79 | export const GET = withRouteHandler( |
| 80 | async (request: NextRequest, { params }: { params: Promise<{ path: string[] }> }) => { |
no outgoing calls
no test coverage detected