1 Star 0 Fork 0

hh/iris

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
utils.go 504 Bytes
Copy Edit Raw Blame History
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.5.2

Search