개인정보 관련 업데이트 진행
ot 정보는 타인이 못봄 휴가신청 관련건도 타인이 못봄
This commit is contained in:
@@ -18,7 +18,34 @@ namespace Project.OWIN
|
||||
{
|
||||
app.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll);
|
||||
|
||||
// 정적 파일 서빙을 가장 먼저 설정 (다른 모든 미들웨어보다 우선)
|
||||
// 캐시 방지 미들웨어를 가장 먼저 설정 (정적 파일 서빙보다 우선)
|
||||
app.Use(async (context, next) =>
|
||||
{
|
||||
var path = context.Request.Path.Value;
|
||||
|
||||
// 모든 정적 리소스에 대해 캐시 방지 헤더 설정
|
||||
if (path.EndsWith(".js") ||
|
||||
path.EndsWith(".css") ||
|
||||
path.EndsWith(".jsx") ||
|
||||
path.EndsWith(".tsx") ||
|
||||
path.EndsWith(".html") ||
|
||||
path.EndsWith(".htm"))
|
||||
{
|
||||
context.Response.Headers["Cache-Control"] = "no-cache, no-store, must-revalidate";
|
||||
context.Response.Headers["Pragma"] = "no-cache";
|
||||
context.Response.Headers["Expires"] = "0";
|
||||
}
|
||||
|
||||
// JSX/TSX 파일을 JavaScript로 처리
|
||||
if (path.EndsWith(".jsx") || path.EndsWith(".tsx"))
|
||||
{
|
||||
context.Response.ContentType = "application/javascript; charset=utf-8";
|
||||
}
|
||||
|
||||
await next();
|
||||
});
|
||||
|
||||
// 정적 파일 서빙 설정
|
||||
var staticFileOptions = new FileServerOptions
|
||||
{
|
||||
EnableDefaultFiles = true,
|
||||
@@ -28,31 +55,6 @@ namespace Project.OWIN
|
||||
};
|
||||
app.UseFileServer(staticFileOptions);
|
||||
|
||||
// 캐시 방지 미들웨어 (정적 파일이 처리되지 않은 경우에만 적용)
|
||||
app.Use(async (context, next) =>
|
||||
{
|
||||
var path = context.Request.Path.Value;
|
||||
|
||||
if (path.EndsWith(".js") ||
|
||||
path.EndsWith(".css") ||
|
||||
path.EndsWith(".jsx") ||
|
||||
path.EndsWith(".tsx") ||
|
||||
path.EndsWith(".html"))
|
||||
{
|
||||
context.Response.Headers["Cache-Control"] = "no-cache, no-store, must-revalidate";
|
||||
context.Response.Headers["Pragma"] = "no-cache";
|
||||
context.Response.Headers["Expires"] = "0";
|
||||
}
|
||||
|
||||
// JSX/TSX 파일을 JavaScript로 처리
|
||||
if (path.EndsWith(".jsx") || path.EndsWith(".tsx"))
|
||||
{
|
||||
context.Response.ContentType = "application/javascript";
|
||||
}
|
||||
|
||||
await next();
|
||||
});
|
||||
|
||||
// Configure Web API for Self-Host (정적 파일 후에 설정)
|
||||
HttpConfiguration config = new HttpConfiguration();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user