Use vspd version as cache buster for .css files.
This will ensure when VSP admins update to a new version of vspd, web visitors will not use cached old .css files.
This commit is contained in:
parent
25ae1b89d6
commit
b9d4db40e9
1
vspd.go
1
vspd.go
@ -94,6 +94,7 @@ func run(ctx context.Context) error {
|
||||
Debug: cfg.WebServerDebug,
|
||||
Designation: cfg.Designation,
|
||||
MaxVoteChangeRecords: maxVoteChangeRecords,
|
||||
VspdVersion: version.String(),
|
||||
}
|
||||
err = webapi.Start(ctx, shutdownRequestChannel, &shutdownWg, cfg.Listen, db,
|
||||
dcrd, wallets, apiCfg)
|
||||
|
||||
@ -35,6 +35,7 @@ type vspStats struct {
|
||||
BlockHeight uint32
|
||||
NetworkProportion float32
|
||||
RevokedProportion float32
|
||||
VspdVersion string
|
||||
}
|
||||
|
||||
var statsMtx sync.RWMutex
|
||||
@ -62,6 +63,7 @@ func initVSPStats() {
|
||||
VspClosed: cfg.VspClosed,
|
||||
Debug: cfg.Debug,
|
||||
Designation: cfg.Designation,
|
||||
VspdVersion: cfg.VspdVersion,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -8,9 +8,9 @@
|
||||
<title>Decred VSP - {{ .VspStats.Designation }}</title>
|
||||
|
||||
<link rel="stylesheet" href="/public/css/vendor/bootstrap.min.css" />
|
||||
<link rel="stylesheet" href="/public/css/vspd.css" />
|
||||
<link rel="stylesheet" href="/public/css/vspd.css?v={{ .VspStats.VspdVersion }}" />
|
||||
<!-- fonts.css should be last to ensure dcr fonts take precedence. -->
|
||||
<link rel="stylesheet" href="/public/css/fonts.css" />
|
||||
<link rel="stylesheet" href="/public/css/fonts.css?v={{ .VspStats.VspdVersion }}" />
|
||||
|
||||
<!-- Custom favicon -->
|
||||
<!-- Apple PWA -->
|
||||
|
||||
@ -35,6 +35,7 @@ type Config struct {
|
||||
Debug bool
|
||||
Designation string
|
||||
MaxVoteChangeRecords int
|
||||
VspdVersion string
|
||||
}
|
||||
|
||||
const (
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user