Merge pull request #5007 from RahulKaushik007/fix-static-file-caching
Fixes #5005: Add Browser Caching for Static Assets
This commit is contained in:
commit
c4308c239c
@ -205,6 +205,7 @@ namespace Oqtane
|
|||||||
ServeUnknownFileTypes = true,
|
ServeUnknownFileTypes = true,
|
||||||
OnPrepareResponse = (ctx) =>
|
OnPrepareResponse = (ctx) =>
|
||||||
{
|
{
|
||||||
|
ctx.Context.Response.Headers.Append("Cache-Control", "public, max-age=604800");
|
||||||
var policy = corsPolicyProvider.GetPolicyAsync(ctx.Context, Constants.MauiCorsPolicy)
|
var policy = corsPolicyProvider.GetPolicyAsync(ctx.Context, Constants.MauiCorsPolicy)
|
||||||
.ConfigureAwait(false).GetAwaiter().GetResult();
|
.ConfigureAwait(false).GetAwaiter().GetResult();
|
||||||
corsService.ApplyResult(corsService.EvaluatePolicy(ctx.Context, policy), ctx.Context.Response);
|
corsService.ApplyResult(corsService.EvaluatePolicy(ctx.Context, policy), ctx.Context.Response);
|
||||||
|
@ -55,4 +55,4 @@
|
|||||||
"Default": "Information"
|
"Default": "Information"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user