All threads / Set up S3 or DO Spaces for storage, and serve stored images through Cloudfront or other CDN

Ask A Question

Notifications

You’re not receiving notifications from this thread.

Set up S3 or DO Spaces for storage, and serve stored images through Cloudfront or other CDN

Ken asked in Rails
Hi all, I'm trying to set up a Rails 5.2 app to directly upload images to Digital Ocean Spaces, and to then serve those images using Cloudfront. I'm able to do direct uploads to Spaces using ActiveStorage following #237, and I've configured Cloudfront as my asset host and everything in app/assets is served from there. But I can't figure out how to get the CDN to serve my images stored on Spaces. I tried nukeproof's workaround here: https://github.com/rails/rails/issues/31419 without success. Any suggestions?
Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 37,344+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2020 GoRails, LLC. All rights reserved.