diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2025-03-13 07:04:50 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-13 07:04:50 +0800 |
commit | 3996518ed432218d7f2fd62d451ee0e29953d853 (patch) | |
tree | 9a3ef66b10e40eeee72c7a63b57f6153eee8a0ac /routers/web/user | |
parent | 91610a987e4c805a9305d4ee951963f80dbeb9ee (diff) | |
download | gitea-3996518ed432218d7f2fd62d451ee0e29953d853.tar.gz gitea-3996518ed432218d7f2fd62d451ee0e29953d853.zip |
Refactor cache-control (#33861)
And fix #21391
Diffstat (limited to 'routers/web/user')
-rw-r--r-- | routers/web/user/avatar.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/web/user/avatar.go b/routers/web/user/avatar.go index 81c00b3bd4..6d3179bc48 100644 --- a/routers/web/user/avatar.go +++ b/routers/web/user/avatar.go @@ -16,7 +16,7 @@ func cacheableRedirect(ctx *context.Context, location string) { // here we should not use `setting.StaticCacheTime`, it is pretty long (default: 6 hours) // we must make sure the redirection cache time is short enough, otherwise a user won't see the updated avatar in 6 hours // it's OK to make the cache time short, it is only a redirection, and doesn't cost much to make a new request - httpcache.SetCacheControlInHeader(ctx.Resp.Header(), 5*time.Minute) + httpcache.SetCacheControlInHeader(ctx.Resp.Header(), &httpcache.CacheControlOptions{MaxAge: 5 * time.Minute}) ctx.Redirect(location) } |