浏览代码

test etag

guoziyun 9 月之前
父节点
当前提交
189712b6bd
共有 2 个文件被更改,包括 5 次插入0 次删除
  1. 2 0
      oms/dist/src/app.js
  2. 3 0
      oms/src/app.ts

+ 2 - 0
oms/dist/src/app.js

@@ -33,6 +33,8 @@ const redisClient = (0, redis_1.createClient)({ url: redisUri }); // 👈 使用
 exports.redisClient = redisClient;
 redisClient.on("connect", () => console.log("Connected to Redis"));
 redisClient.on("error", (err) => console.error("Redis connection error:", err));
+// --- 关键修改:全局禁用 ETag ---
+app.set("etag", false);
 // Connect to Redis when the application starts
 (async () => {
     try {

+ 3 - 0
oms/src/app.ts

@@ -32,6 +32,9 @@ const redisClient = createClient({ url: redisUri }); // 👈 使用解构后的
 redisClient.on("connect", () => console.log("Connected to Redis"));
 redisClient.on("error", (err: any) => console.error("Redis connection error:", err));
 
+// --- 关键修改:全局禁用 ETag ---
+app.set("etag", false);
+
 // Connect to Redis when the application starts
 (async () => {
   try {