Added response compression

This commit is contained in:
2025-10-10 21:19:48 +02:00
parent 0c9b3f8ba7
commit 64c4b22101

View File

@@ -45,6 +45,22 @@ builder.Services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationSc
options.AccessDeniedPath = "/Home/AccessDenied";
});
builder.Services.AddResponseCompression(options =>
{
options.EnableForHttps = true;
options.MimeTypes = new[]
{
"text/plain",
"text/css",
"application/javascript",
"text/html",
"application/xml",
"text/xml",
"application/json",
"image/svg+xml"
};
});
var app = builder.Build();
if (!app.Environment.IsDevelopment())
@@ -76,6 +92,7 @@ if (app.Environment.IsDevelopment())
app.UseStaticFiles();
app.UseRouting();
app.UseAuthorization();
app.UseResponseCompression();
string[] supportedCultures = ["de", "en"];
var localizationOptions = new RequestLocalizationOptions()