Skip to content

Commit

Permalink
Cache 304 responses (closes kotx#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
kotx committed Sep 17, 2022
1 parent 8f91155 commit 8dc6903
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default {
// Since we produce this result from the request, we don't need to strictly use an R2Range
let range: ParsedRange | undefined;

if (!response || !response.ok) {
if (!response || !(response.ok || response.status == 304)) {
console.warn("Cache miss");
let path = (env.PATH_PREFIX || "") + decodeURIComponent(url.pathname.substring(1));

Expand Down

0 comments on commit 8dc6903

Please sign in to comment.