fix: 静态资源加缓存破坏版本号,解决浏览器缓存旧 JS 导致功能不生效
- 启动时生成 AssetVersion(base36 时间戳),注入模板 {{.V}}
- 所有 JS/CSS 引用加 ?v={{.V}},重启即刷新缓存
- 涉及前端、管理后台共 12 个模板文件
This commit is contained in:
@ -13,9 +13,9 @@
|
||||
{{if .OgURL}}<meta property="og:url" content="{{.OgURL}}">{{end}}
|
||||
{{end}}
|
||||
<title>{{.Title}} - MetaLab</title>
|
||||
<link rel="stylesheet" href="/static/css/common.css">
|
||||
<link rel="stylesheet" href="/static/css/common.css?v={{.V}}">
|
||||
{{if .ExtraCSS}}
|
||||
<link rel="stylesheet" href="{{.ExtraCSS}}">
|
||||
<link rel="stylesheet" href="{{.ExtraCSS}}?v={{.V}}">
|
||||
{{end}}
|
||||
<script src="/shared/static/js/utils.js"></script>
|
||||
</head>
|
||||
|
||||
Reference in New Issue
Block a user