Skip to content

Commit

Permalink
fix: do not cache response for range request
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Onnikov <[email protected]>
  • Loading branch information
aonnikov committed Oct 22, 2024
1 parent 215ffa9 commit 7131cde
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion workers/datalake/src/blob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ export async function handleBlobGet (
const status = length !== undefined && length < object.size ? 206 : 200

const response = new Response(object?.body, { headers, status })
ctx.waitUntil(cache.put(request, response.clone()))
if (response.status === 200) {
ctx.waitUntil(cache.put(request, response.clone()))
}

return response
}
Expand Down

0 comments on commit 7131cde

Please sign in to comment.