mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-11 13:37:29 -06:00
[bugfix] Set Vary header correctly on cache-control (#1988)
* [bugfix] Set Vary header correctly on cache-control * Prefer activitypub types on AP endpoints * use immutable on file server, vary by range * vary auth on Accept
This commit is contained in:
parent
88688899aa
commit
12b6cdcd8c
19 changed files with 132 additions and 41 deletions
|
|
@ -95,7 +95,7 @@ func (m *Module) ServeFile(c *gin.Context) {
|
|||
// Derive the max-age value from how long the link has left until
|
||||
// it expires.
|
||||
maxAge := int(time.Until(content.URL.Expiry).Seconds())
|
||||
c.Header("Cache-Control", "private,max-age="+strconv.Itoa(maxAge))
|
||||
c.Header("Cache-Control", "private, max-age="+strconv.Itoa(maxAge)+", immutable")
|
||||
c.Redirect(http.StatusFound, content.URL.String())
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue