Added light cache-control headers on miner output on api and web
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
a2b701e87b
commit
5e9bc7e825
|
@ -411,6 +411,13 @@ func main() {
|
|||
}
|
||||
|
||||
writer.Header().Set("Content-Type", "application/json; charset=utf-8")
|
||||
|
||||
if lastShareTimestamp < uint64(time.Now().Unix()-3600) {
|
||||
writer.Header().Set("cache-control", "public; max-age=600")
|
||||
} else {
|
||||
writer.Header().Set("cache-control", "public; max-age=60")
|
||||
}
|
||||
|
||||
writer.WriteHeader(http.StatusOK)
|
||||
buf, _ := encodeJson(request, utils2.MinerInfoResult{
|
||||
Id: miner.Id(),
|
||||
|
|
|
@ -1332,6 +1332,12 @@ func main() {
|
|||
ctx["share_sweeps"] = likelySweeps
|
||||
ctx["share_sweeps_count"] = sweepsCount
|
||||
|
||||
if block.Timestamp < uint64(time.Now().Unix()-60) {
|
||||
writer.Header().Set("cache-control", "public; max-age=604800")
|
||||
} else {
|
||||
writer.Header().Set("cache-control", "public; max-age=60")
|
||||
}
|
||||
|
||||
render(request, writer, "share.html", ctx)
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in a new issue