mirror of
https://github.com/LD-Reborn/Berufsschule_HAM.git
synced 2025-12-20 06:51:55 +00:00
Improved loading times, improved SEO for lighthouse
This commit is contained in:
@@ -48,8 +48,8 @@ builder.Services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationSc
|
||||
builder.Services.AddResponseCompression(options =>
|
||||
{
|
||||
options.EnableForHttps = true;
|
||||
options.MimeTypes = new[]
|
||||
{
|
||||
options.MimeTypes =
|
||||
[
|
||||
"text/plain",
|
||||
"text/css",
|
||||
"application/javascript",
|
||||
@@ -58,7 +58,7 @@ builder.Services.AddResponseCompression(options =>
|
||||
"text/xml",
|
||||
"application/json",
|
||||
"image/svg+xml"
|
||||
};
|
||||
];
|
||||
});
|
||||
|
||||
var app = builder.Build();
|
||||
@@ -89,7 +89,22 @@ if (app.Environment.IsDevelopment())
|
||||
app.UseSwaggerUI();
|
||||
}
|
||||
|
||||
app.UseStaticFiles();
|
||||
app.UseStaticFiles(new StaticFileOptions
|
||||
{
|
||||
OnPrepareResponse = ctx =>
|
||||
{
|
||||
string requestPath = ctx.Context.Request.Path.ToString();
|
||||
if (requestPath.EndsWith(".css") || requestPath.EndsWith(".js"))
|
||||
{
|
||||
ctx.Context.Response.GetTypedHeaders().CacheControl =
|
||||
new Microsoft.Net.Http.Headers.CacheControlHeaderValue()
|
||||
{
|
||||
Public = true,
|
||||
MaxAge = TimeSpan.FromDays(365)
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
app.UseRouting();
|
||||
app.UseAuthorization();
|
||||
app.UseResponseCompression();
|
||||
|
||||
@@ -4,15 +4,17 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="description" content="Hardware asset management tool" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>@ViewData["Title"] - Berufsschule_HAM</title>
|
||||
<script type="importmap"></script>
|
||||
@* <link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" /> *@
|
||||
@* <link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" asp-append-version="true"/> *@
|
||||
<link rel="stylesheet"
|
||||
href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css"
|
||||
crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
|
||||
|
||||
@* <link rel="stylesheet" href="~/css/site.css" asp-append-version="true" /> *@
|
||||
<link rel="preload" href="~/css/site.css" as="style" onload="this.onload=null;this.rel='stylesheet'">
|
||||
<noscript><link rel="stylesheet" href="~/css/site.css"></noscript>
|
||||
<link rel="stylesheet" href="~/Berufsschule_HAM.styles.css" asp-append-version="true" />
|
||||
</head>
|
||||
<body data-bs-theme="dark">
|
||||
@@ -71,10 +73,10 @@
|
||||
© 2025 - Berufsschule_HAM
|
||||
</div>
|
||||
</footer>
|
||||
@* <script src="~/lib/jquery/dist/jquery.min.js"></script> *@
|
||||
@* <script src="~/lib/jquery/dist/jquery.min.js" defer></script> *@
|
||||
<script src="https://code.jquery.com/jquery-3.7.1.min.js"
|
||||
crossorigin="anonymous" defer></script>
|
||||
@* <script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js"></script> *@
|
||||
@* <script src="~/lib/bootstrap/dist/js/bootstrap.bundle.min.js" defer></script> *@
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"
|
||||
crossorigin="anonymous" defer></script>
|
||||
<script src="~/js/site.js" asp-append-version="true" defer></script>
|
||||
|
||||
Reference in New Issue
Block a user