> ## Content Index
> Fetch the complete content index at: https://www.frank.be/llms.txt
> Use this file to discover other available public pages before exploring further.

# Mephisto multiple_asset_hosts support
- URL: https://www.frank.be/20071220mephisto-multiple_asset_hosts-support/
- Published: 2007-12-19T23:00:00.000Z
- Updated: 2026-06-21T17:37:57.000Z
- Author: Frank Louwers

(Dit artikeltje is even in het Engels omdat het interessant kan zijn voor een internationaler publiek).

One of the [new features of Rails 2.0](http://weblog.rubyonrails.org/2007/12/7/rails-2-0-it-s-done?ref=frank.be) is built-in support for multiple asset hosts. This means you can "cheat" you browsers so they'll load your css, javascript etc faster. For more detailed information about this "issue", I suppose you use our [mutual friend](http://google.com/?ref=frank.be) or read [this interesting article](http://www.die.net/musings/page%5Fload%5Ftime/?ref=frank.be). In Rails 2, you are allowed to put the following code in your `config/environments/production.rb `:

```
config.action_controller.asset_host = "http://%d.assets-blog.frank.be"

```

Your Rail 2 application will now "balance" the links to your javascript files, css files and "assets" such as images over [http://0.assets-blog.frank.be](http://0.assets-blog.frank.be/?ref=frank.be), [http://1.assets-blog.frank.be](http://1.assets-blog.frank.be/?ref=frank.be), [http://2.assets-blog.frank.be](http://2.assets-blog.frank.be/?ref=frank.be) and [http://3.assets-blog.frank.be](http://3.assets-blog.frank.be/?ref=frank.be). Your visitor's browsers will now think these are all different hosts, and will open more connections to the webserver, making your site appear faster.

However, it seems that [Mephisto](http://mephistoblog.com/?ref=frank.be) or at least the Liquid templating engine it uses, doesn't use the standard Rails functions to calculate the asset hosts, it just constructs them by hand, which kind of sucks of course.

With the help of my colleague [Jan](http://blog.defv.be/?ref=frank.be), I've written a small plugin you can install that will use the distributed asset hosts feature. You can install it using the following command:

<macro:code>  
script/plugin install   
svn://november.openminds.be/usr/local/svn/plugins/zliquid\_multiple\_asset\_hosts  
</macro:code>

Enjoy :)