1 Star 0 Fork 0

hh/iris

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
utils.go 504 Bytes
一键复制 编辑 原始数据 按行查看 历史
package client
import (
"net/http"
"time"
"github.com/kataras/iris/cache/entry"
)
// GetMaxAge parses the "Cache-Control" header
// and returns a LifeChanger which can be passed
// to the response's Reset
func GetMaxAge(r *http.Request) entry.LifeChanger {
return func() time.Duration {
cacheControlHeader := r.Header.Get("Cache-Control")
// headerCacheDur returns the seconds
headerCacheDur := entry.ParseMaxAge(cacheControlHeader)
return time.Duration(headerCacheDur) * time.Second
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/w1229748769/iris.git
git@gitee.com:w1229748769/iris.git
w1229748769
iris
iris
v8.3.4

搜索帮助