(cacheKey string, serverCacheTime int, serverCacheUint string)
| 303 | } |
| 304 | |
| 305 | func (l *Location) AddServerCache(cacheKey string, serverCacheTime int, serverCacheUint string) { |
| 306 | l.UpdateDirective("proxy_ignore_headers", []string{"Set-Cookie", "Cache-Control", "expires"}) |
| 307 | l.UpdateDirective("proxy_cache", []string{cacheKey}) |
| 308 | l.UpdateDirective("proxy_cache_key", []string{"$host$uri$is_args$args"}) |
| 309 | l.UpdateDirective("proxy_cache_valid", []string{"200", "304", "301", "302", strconv.Itoa(serverCacheTime) + serverCacheUint}) |
| 310 | l.Cache = true |
| 311 | l.ServerCacheTime = serverCacheTime |
| 312 | l.ServerCacheUint = serverCacheUint |
| 313 | } |
| 314 | |
| 315 | func (l *Location) RemoveBrowserCache() { |
| 316 | l.RemoveDirectiveByFullParams("if", []string{"(", "$uri", "~*", `"\.(gif|png|jpg|css|js|woff|woff2)$"`, ")"}) |
no test coverage detected