Skip to content

Commit 69e7d86

Browse files
authored
Set Cache-Control to reduce invocations (#31)
1 parent 77782f1 commit 69e7d86

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cloudflare/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ export default {
3434
</html>`,
3535
{
3636
headers: {
37-
"content-type": "text/html;charset=UTF-8",
37+
"Content-Type": "text/html;charset=UTF-8",
38+
"Cache-Control": "max-age=600", // 10 min
3839
},
3940
},
4041
);
@@ -57,6 +58,7 @@ export default {
5758
} else {
5859
return new Response("not found", { status: 404 });
5960
}
61+
res.headers.set("Cache-Control", "max-age=600"); // 10 min
6062

6163
return res.toResponse();
6264
},

0 commit comments

Comments
 (0)