MCPcopy Index your code
hub / github.com/simstudioai/sim / resolveServeCacheControl

Function resolveServeCacheControl

apps/sim/app/api/files/serve/[...path]/route.ts:71–77  ·  view source on GitHub ↗

* 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
)

Source from the content-addressed store, hash-verified

69 * reads stay revalidated because the same storage key is edited in place.
70 */
71function 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
79export const GET = withRouteHandler(
80 async (request: NextRequest, { params }: { params: Promise<{ path: string[] }> }) => {

Callers 2

handleLocalFileFunction · 0.85
handleCloudProxyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected