diff --git a/app/controllers/user_avatars_controller.rb b/app/controllers/user_avatars_controller.rb index abf24083139..c943d32615c 100644 --- a/app/controllers/user_avatars_controller.rb +++ b/app/controllers/user_avatars_controller.rb @@ -192,7 +192,7 @@ class UserAvatarsController < ApplicationController end def redirect_s3_avatar(url) - immutable_for 1.hour + immutable_for 1.day redirect_to url, allow_other_host: true end diff --git a/spec/requests/user_avatars_controller_spec.rb b/spec/requests/user_avatars_controller_spec.rb index 45e7851e405..db4146208a9 100644 --- a/spec/requests/user_avatars_controller_spec.rb +++ b/spec/requests/user_avatars_controller_spec.rb @@ -139,7 +139,7 @@ RSpec.describe UserAvatarsController do expect(response.status).to eq(302) expect(response.location).to eq("https://s3-cdn.example.com/optimized/path") - expect(response.headers["Cache-Control"]).to eq("max-age=3600, public, immutable") + expect(response.headers["Cache-Control"]).to eq("max-age=86400, public, immutable") end it "serves new version for old urls" do