mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 17:41:57 +08:00
feat(cache): set max-age for public accessible static resources
This commit is contained in:
@@ -76,8 +76,6 @@ type ThemeChose struct {
|
||||
Theme string `json:"theme" binding:"required,hexcolor|rgb|rgba|hsl"`
|
||||
}
|
||||
|
||||
const avatarMaxAge = 3600
|
||||
|
||||
// Update 更新主题设定
|
||||
func (service *ThemeChose) Update(c *gin.Context, user *model.User) serializer.Response {
|
||||
user.OptionsSerialized.PreferredTheme = service.Theme
|
||||
@@ -196,8 +194,6 @@ func (service *AvatarService) Get(c *gin.Context) serializer.Response {
|
||||
"l": model.GetSettingByName("avatar_size_l"),
|
||||
}
|
||||
|
||||
c.Header("Cache-Control", fmt.Sprintf("max-age=%d", avatarMaxAge))
|
||||
|
||||
// Gravatar 头像重定向
|
||||
if user.Avatar == "gravatar" {
|
||||
server := model.GetSettingByName("gravatar_server")
|
||||
|
||||
Reference in New Issue
Block a user