Created
October 16, 2011 16:15
-
-
Save ChadMoran/1291089 to your computer and use it in GitHub Desktop.
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
# Full error reports are disabled and caching is turned on | |
config.consider_all_requests_local = false | |
config.action_controller.perform_caching = true | |
# Disable Rails's static asset server (Apache or nginx will already do this) | |
config.serve_static_assets = true | |
config.static_cache_control = "public, max-age=31556926" | |
# Compress JavaScripts and CSS | |
config.assets.compress = true | |
# Don't fallback to assets pipeline if a precompiled asset is missed | |
config.assets.compile = true | |
# Generate digests for assets URLs | |
config.assets.digest = true |
I didn't put those comments in there, sorry they should be removed. They were from the normal production.rb.
I can confirm this works
http://d10jcizdv7jp27.cloudfront.net/assets/application-6b58f8d64acb2c27182c694b2fd87c8d.js
Look at the headers.
$ curl -I http://d10jcizdv7jp27.cloudfront.net/assets/application-6b58f8d64acb2c27182c694b2fd87c8d.js
Cache-Control: public, max-age=31556926
Oh ok, and benchmark/comparison with "ordinary heroku"?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So the comment "# Disable Rails's static asset server" should be changed to "enable"?
Did you test it / benchmark it? I haven't heared of using unicorn itself for serving static files.