This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

mazegame: no-cache on the html routes too

+16 -12
+16 -12
2configs/mazegame.nix
··· 18 18 services.nginx.virtualHosts.${domain} = { 19 19 enableACME = true; 20 20 forceSSL = true; 21 - # nginx hands out the client straight from the store. The game server is a 22 - # single event loop: every .js it serves during a join burst is time it is 23 - # not spending on the world tick, and a crowd arriving costs six files 24 - # each. 25 - # …the very package the service runs, so the client never lags the server. 21 + # nginx hands out the client straight from the store — the very package 22 + # the service runs, so the page never lags the server. The game is a 23 + # single event loop: every .js it serves during a join burst is a tick it 24 + # is not spending on the world, and a crowd arriving costs six files each. 26 25 root = config.services.mazegame.package.static; 27 26 locations."/" = { 28 27 index = "index.html"; 29 28 tryFiles = "$uri $uri/ =404"; 30 - extraConfig = '' 31 - # Versions ride in the store path, but the URLs never change, so let 32 - # the browser revalidate rather than cache a stale client. 33 - add_header Cache-Control "no-cache"; 34 - ''; 29 + # Versions ride in the store path but the URLs never change, so let the 30 + # browser revalidate against the ETag rather than cache a stale client. 31 + # add_header does not inherit into the exact-match locations below. 32 + extraConfig = ''add_header Cache-Control "no-cache";''; 35 33 }; 36 - locations."= /play".tryFiles = "/index.html =404"; 37 - locations."= /watch".tryFiles = "/watch.html =404"; 34 + locations."= /play" = { 35 + tryFiles = "/index.html =404"; 36 + extraConfig = ''add_header Cache-Control "no-cache";''; 37 + }; 38 + locations."= /watch" = { 39 + tryFiles = "/watch.html =404"; 40 + extraConfig = ''add_header Cache-Control "no-cache";''; 41 + }; 38 42 39 43 # Player and watcher sockets stay open for as long as someone is in the 40 44 # maze; players heartbeat every 3s, watchers every 3s, so the default