Merge pull request #1690 from basecamp/flavorjones/more-avatars

User avatar responses have cache-control "public"
This commit is contained in:
Mike Dalessio
2025-11-21 16:17:54 -05:00
committed by GitHub
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ class Users::AvatarsController < ApplicationController
if @user == Current.user
{}
else
{ max_age: 30.minutes, stale_while_revalidate: 1.week }
{ max_age: 30.minutes, stale_while_revalidate: 1.week, public: true }
end
end
@@ -15,6 +15,7 @@ class Users::AvatarsControllerTest < ActionDispatch::IntegrationTest
test "show other initials with caching" do
get user_avatar_path(users(:kevin))
assert_match "image/svg+xml", @response.content_type
assert @response.cache_control[:public]
assert_equal 30.minutes.to_s, @response.cache_control[:max_age]
end