Last active
October 12, 2015 13:45
-
-
Save seanhandley/f2ae2a4c855d04dcf96c to your computer and use it in GitHub Desktop.
Separate Assets Host
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use rsync during your deployment process to sync | |
rake assets:precompile | |
rsync -avzhe ssh /home/rails/my_app/public/* user@assets.example.com:/public_html/ | |
# Now your Rails app will fetch assets from the assets server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set Rails to use your new assets host | |
Rails.application.configure do | |
# ... | |
# Generate digests for assets URLs. | |
config.assets.digest = true | |
config.action_controller.asset_host = "//assets.example.com" | |
config.action_mailer.asset_host = config.action_controller.asset_host | |
# ... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment