mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-05-21 17:00:01 +02:00
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.
This commit is contained in:
parent
368d43643f
commit
ccb3851281
3 changed files with 32 additions and 0 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue