Use precompressed static assets
This commit is contained in:
parent
9281e14ccb
commit
c63b7efed6
|
@ -1,3 +1,4 @@
|
|||
using CompressedStaticFiles;
|
||||
using LinqToDB.Data;
|
||||
using Microsoft.AspNetCore.StaticFiles;
|
||||
using zotanpw.Backend;
|
||||
|
@ -9,6 +10,7 @@ Migrations.RunMigrations();
|
|||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
builder.Services.AddRazorPages();
|
||||
builder.Services.AddCompressedStaticFiles();
|
||||
builder.Services.AddSession(options => {
|
||||
options.IdleTimeout = TimeSpan.MaxValue;
|
||||
options.Cookie.HttpOnly = true;
|
||||
|
@ -30,7 +32,7 @@ if (!app.Environment.IsDevelopment()) {
|
|||
}
|
||||
|
||||
var provider = new FileExtensionContentTypeProvider { Mappings = { [".gpg"] = "application/pgp-signature" } };
|
||||
app.UseStaticFiles(new StaticFileOptions { ContentTypeProvider = provider });
|
||||
app.UseCompressedStaticFiles(new StaticFileOptions { ContentTypeProvider = provider });
|
||||
|
||||
app.UseStatusCodePagesWithReExecute("/error");
|
||||
|
||||
|
|
BIN
wwwroot/css/site.css.br
Normal file
BIN
wwwroot/css/site.css.br
Normal file
Binary file not shown.
BIN
wwwroot/favicon.ico.br
Normal file
BIN
wwwroot/favicon.ico.br
Normal file
Binary file not shown.
BIN
wwwroot/files/blog/adhd-and-notes.png.br
Normal file
BIN
wwwroot/files/blog/adhd-and-notes.png.br
Normal file
Binary file not shown.
BIN
wwwroot/files/help.svg.br
Normal file
BIN
wwwroot/files/help.svg.br
Normal file
Binary file not shown.
|
@ -16,6 +16,7 @@
|
|||
<PackageReference Include="System.Data.SQLite.Core.osx.arm64" Version="1.0.117" />
|
||||
<PackageReference Include="System.ServiceModel.Syndication" Version="8.0.0" />
|
||||
<PackageReference Include="YamlDotNet" Version="15.1.2" />
|
||||
<PackageReference Include="CompressedStaticFiles" Version="2.2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
Loading…
Reference in a new issue