diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-02-03 01:39:38 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-02 11:39:38 -0600 |
commit | ccb38512818dd3ee86f7960ed6cdf34754e4d09f (patch) | |
tree | 8ef9b1e7fd156cca49132429487622d670597698 /modules | |
parent | 368d43643f8f8ed1bfb1462d5cae586c90e93383 (diff) | |
download | gitea-ccb38512818dd3ee86f7960ed6cdf34754e4d09f.tar.gz gitea-ccb38512818dd3ee86f7960ed6cdf34754e4d09f.zip |
Add some comments for recent code (#22725)
When using the main branch, I found that some changed code didn't have
comments.
This PR adds some comments.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/httpcache/httpcache.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/httpcache/httpcache.go b/modules/httpcache/httpcache.go index d7d9ce0b7e..f0caa30eb8 100644 --- a/modules/httpcache/httpcache.go +++ b/modules/httpcache/httpcache.go @@ -19,6 +19,8 @@ import ( func AddCacheControlToHeader(h http.Header, maxAge time.Duration, additionalDirectives ...string) { directives := make([]string, 0, 2+len(additionalDirectives)) + // "max-age=0 + must-revalidate" (aka "no-cache") is preferred instead of "no-store" + // because browsers may restore some input fields after navigate-back / reload a page. if setting.IsProd { if maxAge == 0 { directives = append(directives, "max-age=0", "private", "must-revalidate") |