Ruby On rails : Distribute asset load to multiple asset host


config.action_controller.asset_host = ""

Browsers typically open at most two simultaneous connections to a single host, which means your assets often have to wait for other assets to finish downloading. You can alleviate this by using a %d wildcard in the asset_host. For example, “”. If that wildcard is present Rails distributes asset requests among the corresponding four hosts “”, …, “”. With this trick browsers will open eight simultaneous connections rather than two.

# => <img alt="Rails" src="" />
# => <link href="" media="screen" rel="stylesheet" />

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s