User avatar responses have cache-control "public"

ref: https://app.fizzy.do/5986089/cards/3125
This commit is contained in:
Mike Dalessio
2025-11-21 16:07:47 -05:00
committed by Jason Zimdars
parent af0e2488d0
commit ec8974640f
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