refactor(application): 更新 Cache-Control 逻辑与文档说明

- 简化 application.go 中的 Cache-Control 设置,固定为 public,移除 logLevel 对其的控制。
- 更新 var.go 中 logLevel 的说明,明确其不再影响静态资源的 Cache-Control。
- 修改 QuickStart 文档,反映 logLevel 的新行为与静态资源缓存策略。
This commit is contained in:
2026-07-15 23:02:12 +08:00
parent 8a1a27b457
commit f53d406110
4 changed files with 57 additions and 8 deletions
+2 -6
View File
@@ -534,13 +534,9 @@ func (that *Application) handler(w http.ResponseWriter, req *http.Request) {
return
}
//设置header
// 静态资源可缓存;logLevel 只控制日志/SQL,不再改 Cache-Control
delete(header, "Content-Type")
if that.Config.GetCeilInt("logLevel") == 0 {
header.Set("Cache-Control", "public")
} else {
header.Set("Cache-Control", "no-cache")
}
header.Set("Cache-Control", "public")
t := strings.LastIndex(path, ".")
if t != -1 {