User avatar responses have cache-control "public"
ref: https://app.fizzy.do/5986089/cards/3125
This commit is contained in:
committed by
Jason Zimdars
parent
af0e2488d0
commit
ec8974640f
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user