Skip to content

Commit 9d1f810

Browse files
committed
Отключается кеширование контента
1 parent 29c64d2 commit 9d1f810

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Excursion360.Desktop/Program.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@
4646
fso.StaticFileOptions.ContentTypeProvider = provider;
4747
fso.StaticFileOptions.OnPrepareResponse = (context) =>
4848
{
49+
// При локальной работе нет необходимости кешировать файлы
50+
context.Context.Response.Headers.CacheControl = "no-cache, no-store";
51+
context.Context.Response.Headers.Pragma = "no-cache";
52+
context.Context.Response.Headers.Expires = "-1";
4953
if (context.File.Name.EndsWith(".jpg", StringComparison.OrdinalIgnoreCase) && context.File.PhysicalPath is not null)
5054
{
5155
var stateImagesMetricsStore = context.Context.RequestServices.GetRequiredService<IStateImagesMetricsStore>();

0 commit comments

Comments
 (0)