Skip to content

Commit 52f781e

Browse files
authored
Add cache control header (#155)
* add cache-control header to CSR server add a maxAge configuration = 1 year for CSR simple server to match what SSR server automatically configures * Update utils.ts * Update utils.ts * Update utils.ts * update maxAge to have traditional seconds-calendar year calculation
1 parent bb8eb99 commit 52f781e

File tree

1 file changed

+2
-1
lines changed
  • packages/@apphosting/adapter-angular/src/simple-server

1 file changed

+2
-1
lines changed

packages/@apphosting/adapter-angular/src/simple-server/server.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ import { fileURLToPath } from "url";
44
const app = express();
55
const __filename = fileURLToPath(import.meta.url);
66
const __dirname = path.dirname(__filename);
7+
const oneYear = 31_536_000_000;
78

8-
app.use(express.static(path.join(__dirname, "..", "browser")));
9+
app.use(express.static(path.join(__dirname, "..", "browser"), { maxAge: oneYear }));
910
app.get("*", function (request, response) {
1011
response.sendFile(path.join(__dirname, "..", "browser", "index.html"));
1112
});

0 commit comments

Comments
 (0)