mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-23 14:40:36 +01:00
Cache static assets for one year and set the correct cache control header. Adds the cache busting version based on file content to asset references to invalidate the cache on change. ([further details on the approach](https://andrewlock.net/adding-cache-control-headers-to-static-files-in-asp-net-core/) and [why one year](https://ashton.codes/set-cache-control-max-age-1-year/)) Most of the changes are the additions of the `asp-append-version="true"` attribute, the main configuration change is in `Startup.cs`.
23 lines
1.2 KiB
Text
23 lines
1.2 KiB
Text
@inject BTCPayServer.HostedServices.CssThemeManager themeManager
|
|
@addTagHelper *, BundlerMinifier.TagHelpers
|
|
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<meta name="description" content="">
|
|
<meta name="author" content="">
|
|
@if (themeManager.DiscourageSearchEngines)
|
|
{
|
|
<meta name="robots" content="noindex">
|
|
}
|
|
<title>@ViewData["Title"]</title>
|
|
@* CSS *@
|
|
<link href="@this.Context.Request.GetRelativePathOrAbsolute(themeManager.BootstrapUri)" rel="stylesheet" asp-append-version="true" />
|
|
<link href="@this.Context.Request.GetRelativePathOrAbsolute(themeManager.CreativeStartUri)" rel="stylesheet" asp-append-version="true" />
|
|
<link href="@this.Context.Request.GetRelativePathOrAbsolute(themeManager.ThemeUri)" rel="stylesheet" asp-append-version="true" />
|
|
@if (!String.IsNullOrWhiteSpace(themeManager.CustomThemeUri))
|
|
{
|
|
<link href="@this.Context.Request.GetRelativePathOrAbsolute(themeManager.CustomThemeUri)" rel="stylesheet" asp-append-version="true" />
|
|
}
|
|
<bundle name="wwwroot/bundles/main-bundle.min.css" asp-append-version="true" />
|
|
@* JS *@
|
|
<bundle name="wwwroot/bundles/main-bundle.min.js" asp-append-version="true" />
|