diff options
author | silverwind <me@silverwind.io> | 2022-08-23 14:58:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-23 20:58:04 +0800 |
commit | 56220515fc882943e366fafbce4d5b2b3ccee702 (patch) | |
tree | d64bffc3a9d13ce01bf56aedc896923aa4af0acf /templates/base/head.tmpl | |
parent | 0a9ed54abbe8b6837dcb22a35b744c11f410421f (diff) | |
download | gitea-56220515fc882943e366fafbce4d5b2b3ccee702.tar.gz gitea-56220515fc882943e366fafbce4d5b2b3ccee702.zip |
Enable contenthash in filename for dynamic assets (#20813)
This should solve the main problem of dynamic assets getting stale after
a version upgrade. Everything not affected will use query-string based
cache busting, which includes files loaded via HTML or worker scripts.
Diffstat (limited to 'templates/base/head.tmpl')
-rw-r--r-- | templates/base/head.tmpl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl index e0d2b26f2c..233cf3e1d5 100644 --- a/templates/base/head.tmpl +++ b/templates/base/head.tmpl @@ -21,7 +21,7 @@ {{end}} <link rel="icon" href="{{AssetUrlPrefix}}/img/favicon.svg" type="image/svg+xml"> <link rel="alternate icon" href="{{AssetUrlPrefix}}/img/favicon.png" type="image/png"> - <link rel="stylesheet" href="{{AssetUrlPrefix}}/css/index.css?v={{MD5 AppVer}}"> + <link rel="stylesheet" href="{{AssetUrlPrefix}}/css/index.css?v={{AssetVersion}}"> {{template "base/head_script" .}} <noscript> <style> @@ -67,10 +67,10 @@ <meta property="og:site_name" content="{{AppName}}"> {{if .IsSigned }} {{ if ne .SignedUser.Theme "gitea" }} - <link rel="stylesheet" href="{{AssetUrlPrefix}}/css/theme-{{.SignedUser.Theme | PathEscape}}.css?v={{MD5 AppVer}}"> + <link rel="stylesheet" href="{{AssetUrlPrefix}}/css/theme-{{.SignedUser.Theme | PathEscape}}.css?v={{AssetVersion}}"> {{end}} {{else if ne DefaultTheme "gitea"}} - <link rel="stylesheet" href="{{AssetUrlPrefix}}/css/theme-{{DefaultTheme | PathEscape}}.css?v={{MD5 AppVer}}"> + <link rel="stylesheet" href="{{AssetUrlPrefix}}/css/theme-{{DefaultTheme | PathEscape}}.css?v={{AssetVersion}}"> {{end}} {{template "custom/header" .}} </head> |