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

@@ -27,6 +27,7 @@
"jszip": "^3.10.0",
"morgan": "^1.10.0",
"multer": "^1.4.4",
"nocache": "^3.0.4",
"response-time": "^2.3.2",
"simple-thumbnail": "^1.6.5",
"winston": "^3.7.2",

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}`);
});

View File

@@ -1497,6 +1497,11 @@ negotiator@0.6.3:
resolved "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz"
integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==
nocache@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/nocache/-/nocache-3.0.4.tgz#5b37a56ec6e09fc7d401dceaed2eab40c8bfdf79"
integrity sha512-WDD0bdg9mbq6F4mRxEYcPWwfA1vxd0mrvKOyxI7Xj/atfRHVeutzuWByG//jfm4uPzp0y4Kj051EORCBSQMycw==
node-abi@^2.21.0:
version "2.30.1"
resolved "https://registry.npmjs.org/node-abi/-/node-abi-2.30.1.tgz"