Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

disable caching for frontend assets This aims to fix the issue where it says

Maidul Islambdb36d6be4dd
diff --git a/backend/src/server/plugins/serve-ui.ts b/backend/src/server/plugins/serve-ui.ts
index 22c0977260..fc6b85d3d9 100644
--- a/backend/src/server/plugins/serve-ui.ts
+++ b/backend/src/server/plugins/serve-ui.ts
@@ -57,9 +57,12 @@ export const registerServeUI = async (
reply.callNotFound();
return;
}
- // reference: https://github.com/fastify/fastify-static?tab=readme-ov-file#managing-cache-control-headers
- // to avoid ui bundle skew on new deployment
- return reply.sendFile("index.html", { maxAge: 0, immutable: false });
+
+ // This should help avoid caching any chunks (temp)
+ reply.header('Cache-Control', 'no-cache, no-store, must-revalidate');
+ reply.header('Pragma', 'no-cache');
+ return reply.sendFile("index.html");
+
}
});
}