Add cache-control to CarrierWave when using S3 (#10115)

This commit is contained in:
Mac Siri 2020-08-31 18:54:10 -04:00 committed by GitHub
parent 54c071856e
commit 6771217e6c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -35,6 +35,7 @@ CarrierWave.configure do |config|
aws_secret_access_key: ApplicationConfig["AWS_SECRET"],
region: region
}
config.fog_attributes = { cache_control: "public, max-age=#{365.days.to_i}" }
else
# Fallback on file storage if AWS creds are not present
config.asset_host = "https://#{ApplicationConfig['APP_DOMAIN']}/images"