Thursday, 12 March 2015

asset_host parallel cdn

#To really juice up the load times of your site, configure four subdomains for your assets,
#numbered from 0 to 3, e.g. #assets0.myapp.com to assets3.myapp.com, pointing at your asset CDN and set the following in your
#production configuration:
config.action_controller.asset_host = "assets%d.myapp.com"
#Rails will cycle through each of these subdomains when it generates asset links. Browsers are generally restricted to
#only two concurrent requests per host name, so having assets served from four allows the browser to make eight
#concurrent requests. Page load speeds will now be constrained only by the speed of your user’s connection.#
#If you user has a good connection then they will be able to download most of your assets in parallel.
#<script src="http://assets3.myapp.com/assets/application-79aae679bbfc378424584779fa84a6e8.js"></script>
#<script src="http://assets2.myapp.com/assets/application-79aae679bbfc378424584779fa84a6e8.css"></script>
view raw gistfile1.rb hosted with ❤ by GitHub

No comments:

Post a Comment