Managing requests for static content in WEBrick and Mongrel


Is there a way to set things up so that requests for static files in
either WEBrick or Mongrel will just cause a regular HTTP request and not
cause the dynamic routing-based invocation to occur?

I had an issue where a request for a missing .js file was causing
another request to be registered, thus blowing away my flash data.

I tried to do this in my routing file, but I don’t think it is helping:

map.connect ‘javascripts/*stuff’
map.connect ‘stylesheets/*stuff’

Is there even a notion of separating static from dynamic content within
the WEBrick or Mongrel environments? If so, how is it achieved?


These are instances when a “higher up in the order” webserver would
Try routing from lighty to mongrel and then setting up conditional
rules there.

You can also set up an asset host:

config.action_controller.asset_host = “” (in



Thanks. I’m good in production right now (although using Apache - need
to move to lighty or something else).

I’m wondering if I can control the development Web server to this extent


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs