# 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 @howler,
Ideally ActiveStorage blob will provide us the s3 object key to search at S3 to retrieve/generate the URL. Now that we pointed the storage location to Cloudfront host configured on the bucket, Do we need to configure any thing additionally at cloudfront side(I mean any policies or OAI settings) or will it simply fetch from cloudfront.
Note: I'm new to ActiveStorage, correct me if I didn't convey any thing in right way.