mirror of
https://github.com/LD-Reborn/Berufsschule_HAM.git
synced 2025-12-20 06:51:55 +00:00
Added response compression
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user