优化过时缓存时长(从600秒改为1200秒)

This commit is contained in:
刘祥超
2023-08-27 14:49:28 +08:00
parent 0b4ac55aa6
commit 5b0f94f317
3 changed files with 6 additions and 8 deletions

View File

@@ -982,7 +982,7 @@ func (this *HTTPWriter) DelayRead() bool {
// 计算stale时长
func (this *HTTPWriter) calculateStaleLife() int {
var staleLife = 600 // TODO 可以在缓存策略里设置此时间
var staleLife = caches.DefaultStaleCacheSeconds
var staleConfig = this.req.web.Cache.Stale
if staleConfig != nil && staleConfig.IsOn {
// 从Header中读取stale-if-error