Fix dev caching issue

This commit is contained in:
SleeplessOne1917 2023-06-29 16:33:08 -04:00
parent 9e7fec772d
commit 2d88e42cab
2 changed files with 9 additions and 5 deletions

View file

@ -29,10 +29,13 @@ export function setCacheControl(
) {
const user = UserService.Instance;
let caching: string;
console.log("In middleware");
console.log(process.env.NODE_ENV);
if (
req.path.match(/\.(js|css|txt|manifest\.webmanifest)\/?$/) ||
req.path.includes("/css/themelist")
process.env.NODE_ENV === "production" &&
(req.path.match(/\.(js|css|txt|manifest\.webmanifest)\/?$/) ||
req.path.includes("/css/themelist"))
) {
// Static content gets cached publicly for a day
caching = "public, max-age=86400";