修复每次都回源, 把默认etag改为静态值

This commit is contained in:
wood chen 2024-09-29 03:21:26 +08:00
parent b5fb5b84a0
commit d976d8f7cb

View File

@ -7,7 +7,6 @@ import (
"path" "path"
"path/filepath" "path/filepath"
"strings" "strings"
"time"
"webp_server_go/config" "webp_server_go/config"
"webp_server_go/helper" "webp_server_go/helper"
@ -152,6 +151,7 @@ func pingURL(url string) string {
} }
func generateFallbackIdentifier(url string) string { func generateFallbackIdentifier(url string) string {
// 使用 URL 和当前时间生成一个唯一标识符 // 使用 URL 的哈希值作为稳定的标识符
return "fallback-" + helper.HashString(url + time.Now().String()) return "fallback-" + helper.HashString(url)
} }