Skip to content

armgit / soju

Public Imported from GitHub
0

Play Windows games on Apple Silicon Macs. Free, open-source app that installs the official Battle.net, Steam, Epic and GOG launchers and lists your games in one library.

site-worker: don't cache error responses

mikey9253143e7c1883
diff --git a/site-worker/worker.js b/site-worker/worker.js
index 78c11e59971..2bf8dfb534b 100644
--- a/site-worker/worker.js
+++ b/site-worker/worker.js
@@ -68,7 +68,7 @@ export default {
}
if (url.pathname === "/api/didim/download") return download(request, env);
const upstream = new URL("https://bcd1210.github.io/soju" + url.pathname + url.search);
- const res = await fetch(upstream, { headers: { "User-Agent": "soju-site" }, cf: { cacheTtl: 300 } });
+ const res = await fetch(upstream, { headers: { "User-Agent": "soju-site" }, cf: { cacheTtlByStatus: { "200-299": 300, "300-599": 0 } } });
const headers = new Headers(res.headers);
headers.delete("content-security-policy");
return new Response(res.body, { status: res.status, headers });