IO-2060 Force no cache on LMS.

This commit is contained in:
Patrick Fic
2022-09-22 10:06:05 -07:00
parent 7f6bde6e53
commit 8b57c9c19a
3 changed files with 13 additions and 2 deletions

View File

@@ -15,7 +15,7 @@ import BillRequestValidator from "./bills/billRequestValidator";
import cors from "cors";
import helmet from "helmet";
import responseTime from "response-time";
import nocache from "nocache";
import {
BillsMediaUploadMulter,
BillsUploadMedia,
@@ -107,6 +107,8 @@ if (process.env.NODE_ENV !== "production") {
const app: Express = express();
const port = process.env.PORT;
app.set("etag", false);
app.use(nocache());
app.use(bodyParser.json({ limit: "1000mb" }));
app.use(bodyParser.urlencoded({ limit: "1000mb", extended: true }));
app.use(responseTime());
@@ -167,7 +169,10 @@ app.get(
InitServer();
app.use(FolderPaths.StaticPath, express.static(FolderPaths.Root, {}));
app.use("/assets", express.static("./assets", {}));
app.use(
"/assets",
express.static("./assets", { etag: false, maxAge: 30 * 1000 })
);
app.listen(port, () => {
logger.info(`ImEX Media Server is running at http://localhost:${port}`);
});