increase edge cache TTL (we're purging cache on deploys anyway)

This commit is contained in:
2020-06-03 16:41:47 -04:00
parent a0c59dcdc3
commit 446a4b85ef
2 changed files with 5 additions and 2 deletions
+2
View File
@@ -33,6 +33,8 @@ if (window.WebSocket) {
var rfb = new RFB({ target: display, encrypt: true }); var rfb = new RFB({ target: display, encrypt: true });
rfb.connect("sandbox.y2k.lol", 443); rfb.connect("sandbox.y2k.lol", 443);
} }
</script>
<script>
var random_tile = Math.floor(Math.random() * 20); var random_tile = Math.floor(Math.random() * 20);
document.body.style.backgroundImage = 'url("tiles/tile_' + random_tile + '.png")'; document.body.style.backgroundImage = 'url("tiles/tile_' + random_tile + '.png")';
</script> </script>
+3 -2
View File
@@ -28,10 +28,11 @@ async function handleEvent(event) {
let options = { let options = {
cacheControl: { cacheControl: {
browserTTL: 3600, browserTTL: 3600,
edgeTTL: 604800,
} }
} }
let headers = { const headers = {
'X-XSS-Protection': '1; mode=block', 'X-XSS-Protection': '1; mode=block',
'X-Frame-Options': 'DENY', 'X-Frame-Options': 'DENY',
'X-Content-Type-Options': 'nosniff', 'X-Content-Type-Options': 'nosniff',
@@ -63,6 +64,6 @@ async function handleEvent(event) {
} catch (e) {} } catch (e) {}
} }
return new Response(e.message || e.toString(), { headers, status: 500 }) return new Response(e.message || e.toString(), { status: 500 })
} }
} }