diff --git a/BTCPayServer/Hosting/Startup.cs b/BTCPayServer/Hosting/Startup.cs
index 55d347db1..b797bfc97 100644
--- a/BTCPayServer/Hosting/Startup.cs
+++ b/BTCPayServer/Hosting/Startup.cs
@@ -18,6 +18,7 @@ using System.IO;
using Microsoft.Extensions.DependencyInjection.Extensions;
using BTCPayServer.Security;
using Microsoft.AspNetCore.Server.Kestrel.Core;
+using Microsoft.Net.Http.Headers;
using System.Net;
using BTCPayServer.PaymentRequest;
using BTCPayServer.Services.Apps;
@@ -189,7 +190,17 @@ namespace BTCPayServer.Hosting
app.UseRouting();
app.UseCors();
- app.UseStaticFiles();
+ app.UseStaticFiles(new StaticFileOptions
+ {
+ OnPrepareResponse = ctx =>
+ {
+ // Cache static assets for one year, set asp-append-version="true" on references to update on change.
+ // https://andrewlock.net/adding-cache-control-headers-to-static-files-in-asp-net-core/
+ const int durationInSeconds = 60 * 60 * 24 * 365;
+ ctx.Context.Response.Headers[HeaderNames.CacheControl] = "public,max-age=" + durationInSeconds;
+ }
+ });
+
app.UseProviderStorage(options);
app.UseAuthentication();
app.UseAuthorization();
diff --git a/BTCPayServer/Views/Account/LoginWithU2F.cshtml b/BTCPayServer/Views/Account/LoginWithU2F.cshtml
index 97949f43d..682854b98 100644
--- a/BTCPayServer/Views/Account/LoginWithU2F.cshtml
+++ b/BTCPayServer/Views/Account/LoginWithU2F.cshtml
@@ -29,7 +29,7 @@
-
+
-