refactor(application): 更新 Cache-Control 逻辑与文档说明
- 简化 application.go 中的 Cache-Control 设置,固定为 public,移除 logLevel 对其的控制。 - 更新 var.go 中 logLevel 的说明,明确其不再影响静态资源的 Cache-Control。 - 修改 QuickStart 文档,反映 logLevel 的新行为与静态资源缓存策略。
This commit is contained in:
+2
-6
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user