mirror of https://github.com/shunfei/cronsun
Set no cache for index.html
parent
36c2198f47
commit
75c9a83b13
|
@ -1,6 +1,9 @@
|
|||
#!/bin/sh
|
||||
BASEDIR=$(dirname "$0")
|
||||
BASEDIR=$(dirname $(realpath $0))
|
||||
cd $BASEDIR/ui
|
||||
npm run build
|
||||
cd ..
|
||||
go-bindata -pkg "web" -prefix "ui/dist/" -o static_assets.go ./ui/dist/
|
||||
|
||||
VER=$(git rev-parse --short HEAD)
|
||||
sed -i '' -E "s/(build\.js\?v=).{7}/\1${VER}/g" $BASEDIR/ui/index.html
|
||||
|
|
|
@ -144,6 +144,9 @@ func (s *embeddedFileServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
fp += s.IndexFile
|
||||
|
||||
w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
|
||||
w.Header().Set("Expires", "0")
|
||||
|
||||
b, err = Asset(fp)
|
||||
if err == nil {
|
||||
w.Write(b)
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -61,7 +61,7 @@
|
|||
<div id="app">
|
||||
<div id="initloader"></div>
|
||||
</div>
|
||||
<script src="build.js"></script>
|
||||
<script src="build.js?v=36c2198"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
Loading…
Reference in New Issue