Skip to content

Commit

Permalink
about-daangn-com-production: disable dynamic cache
Browse files Browse the repository at this point in the history
  • Loading branch information
cometkim committed Jun 7, 2024
1 parent a8d01e4 commit 0c10676
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions _workers/about-daangn-com-production/functions/serve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ async function getAssetResponse(
): Promise<Response | null> {
console.debug(`getAssetResponse: ${assetPath}`);

console.debug(`cache open: ${cacheName}`);
const cache = await caches.open(cacheName);
// console.debug(`cache open: ${cacheName}`);
// const cache = await caches.open(cacheName);

let res = await cache.match(c.req.raw);
if (res) {
console.debug('cache hit');
return res;
}
// let res = await cache.match(c.req.raw);
// if (res) {
// console.debug('cache hit');
// return res;
// }

const object = await c.env.CONTENT_BUCKET.get(assetPath);
if (!object) {
Expand All @@ -76,7 +76,7 @@ async function getAssetResponse(
headers: objectHeaders,
});

c.executionCtx.waitUntil(cache.put(c.req.raw, res.clone()));
// c.executionCtx.waitUntil(cache.put(c.req.raw, res.clone()));

return res;
}

0 comments on commit 0c10676

Please sign in to comment.