# ENV["ASSETS_HOST"] = 'thing.cloudfront.net'
class Foo < ApplicationRecord
has_one_attached :thing
end
foo = Foo.first
# https://thing.cloudfront.net/rails/active_storage/blobs/etc..etc
proxy_url(foo.image)
# https://thing.cloudfront.net/rails/active_storage/representations/etc..etc
proxy_url(foo.image.variant(resize: '100x100'))
This is nowhere near perfect. Just gets the job done in a simple manner.
Inspiration from https://github.com/rails/rails/pull/34477
Hi
I have tried this and I was able successfully to get this to work. Though my cloud front setup is having issues (which I'm resolving), how you plan to handle the existing objects in S3 with a new CloudFront service in place. Do we need to migrate things or something?