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

This commit is contained in:
GoEdgeLab
2023-08-27 14:49:28 +08:00
parent d209e9611a
commit 501003f1ad
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