ruby-on-railsrubygoogle-cloud-platformcdngoogle-cdn

Rails CDN on Google Cloud Platform with custom Domain


I would like to use CDN on Rails. Currently I'm running the backend on the Google Cloud Platform.

# Serve static files from the `/public` folder by default.
# Consider using a CDN for better performance
config.serve_static_files = true

I found this on config/environments/production.rb

How I can implement that?

Thank you so much for your help


Solution

  • Are you using a HTTP(S) Load Balancer? If so, you just need to enable Cloud CDN on your backend.

    This is the official documentation to get started: https://cloud.google.com/cdn/docs/quickstart