# serve all assets from CDN server
config.action_controller.asset_host = 'http://cdn.mydomain.com'
#or if your files in a folder on CDN server
config.action_controller.asset_host = 'http://cdn.mydomain.com/myfolder'
# serve only images
config.action_controller.asset_host = Proc.new { |source|
if source =~ /\b(.png|.jpg|.gif)\b/i
"http://cdn.mydomain.com"
end
}
Last active
May 24, 2017 11:30
-
-
Save maxivak/5239159 to your computer and use it in GitHub Desktop.
Rails assets and CDN
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment