MCPcopy Index your code
hub / github.com/unpkg/unpkg / createCacheableResponse

Function createCacheableResponse

packages/unpkg-worker/src/lib/cache-utils.ts:1–13  ·  view source on GitHub ↗
(response: Response)

Source from the content-addressed store, hash-verified

1export function createCacheableResponse(response: Response): Response {
2 let clone = response.clone();
3 let headers = new Headers(clone.headers);
4
5 // Cloudflare cannot cache responses with Set-Cookie headers
6 // See https://developers.cloudflare.com/workers/runtime-apis/cache/
7 headers.delete("Set-Cookie");
8
9 return new Response(clone.body, {
10 status: clone.status,
11 headers,
12 });
13}

Callers 3

getPackageInfoFunction · 0.90
fetchFileFunction · 0.90
listFilesFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected