Skip to content

Instantly share code, notes, and snippets.

@toolmantim
Created December 20, 2012 23:40
Show Gist options
  • Select an option

  • Save toolmantim/4349610 to your computer and use it in GitHub Desktop.

Select an option

Save toolmantim/4349610 to your computer and use it in GitHub Desktop.
How to serve up JS assets from your app URL, and all other assets from a CDN
# Serve images and stylesheets (but not JS files) from a CDN
config.action_controller.asset_host = Proc.new {|source|
source !~ /\.js$/ ? "mycdn.com" : nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment