mirror of
				https://github.com/go-gitea/gitea
				synced 2025-10-31 19:38:23 +00:00 
			
		
		
		
	Use a variable but a function for IsProd because of a slight performance increment (#17368)
This commit is contained in:
		| @@ -18,7 +18,7 @@ import ( | ||||
|  | ||||
| // AddCacheControlToHeader adds suitable cache-control headers to response | ||||
| func AddCacheControlToHeader(h http.Header, d time.Duration) { | ||||
| 	if setting.IsProd() { | ||||
| 	if setting.IsProd { | ||||
| 		h.Set("Cache-Control", "private, max-age="+strconv.Itoa(int(d.Seconds()))) | ||||
| 	} else { | ||||
| 		h.Set("Cache-Control", "no-store") | ||||
|   | ||||
		Reference in New Issue
	
	Block a user