From 9b55747657ca446a0d295055cf40f11e2bb56d72 Mon Sep 17 00:00:00 2001 From: sam Date: Tue, 1 Oct 2024 16:27:44 +0200 Subject: [PATCH] fix(frontend): only cache locale files for a minute --- Foxnouns.Frontend/server.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Foxnouns.Frontend/server.js b/Foxnouns.Frontend/server.js index e9e6c4b..f9bc18c 100644 --- a/Foxnouns.Frontend/server.js +++ b/Foxnouns.Frontend/server.js @@ -34,9 +34,13 @@ if (viteDevServer) { app.use("/assets", express.static("build/client/assets", { immutable: true, maxAge: "1y" })); } +// Only cache locales for a minute, as they can change without the filename changing +// TODO: figure out how to change the filenames on update? +app.use(express.static("build/client/locales", { maxAge: "1m" })); + // Everything else (like favicon.ico) is cached for an hour. You may want to be // more aggressive with this caching. -app.use(express.static("build/client", { maxAge: "1h" })); +app.use(express.static("build/client", { maxAge: "1d" })); app.use(morgan("tiny"));