diff --git a/app/controllers/user_avatars_controller.rb b/app/controllers/user_avatars_controller.rb index cf8640e27d8..e5ec3087969 100644 --- a/app/controllers/user_avatars_controller.rb +++ b/app/controllers/user_avatars_controller.rb @@ -29,6 +29,7 @@ class UserAvatarsController < ApplicationController end image = LetterAvatar.generate(params[:username].to_s, params[:size].to_i) + response.headers["Last-Modified"] = File.ctime(image).httpdate expires_in 1.year, public: true send_file image, disposition: nil end diff --git a/lib/letter_avatar.rb b/lib/letter_avatar.rb index 61c80c87e82..d7da8541e57 100644 --- a/lib/letter_avatar.rb +++ b/lib/letter_avatar.rb @@ -25,7 +25,7 @@ class LetterAvatar def cache_path - "tmp/letter_avatars/#{VERSION}" + "public/uploads/letter_avatars/#{VERSION}" end def generate(username, size, opts = nil)