# Managing requests for static content in WEBrick and Mongrel

**URL:** <https://www.ruby-forum.com/t/managing-requests-for-static-content-in-webrick-and-mongrel/69969>\
**Category:** Rails\
**Created:** [September 25, 2006, 11:40pm UTC](https://www.ruby-forum.com/t/managing-requests-for-static-content-in-webrick-and-mongrel/69969 "2006-09-25T23:40:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [September 25, 2006, 11:40pm UTC](https://www.ruby-forum.com/t/managing-requests-for-static-content-in-webrick-and-mongrel/69969/1 "2006-09-25T23:40:34Z")

</div>

All,

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?

Thanks,  
Wes

---

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [September 26, 2006, 10:21am UTC](https://www.ruby-forum.com/t/managing-requests-for-static-content-in-webrick-and-mongrel/69969/2 "2006-09-26T10:21:55Z")

</div>

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

You can also set up an asset host:

config.action\_controller.asset\_host = “[http://myassets.x.com](http://myassets.x.com)” (in  
environments/production.rb)

Vish

---

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [September 26, 2006, 5:12pm UTC](https://www.ruby-forum.com/t/managing-requests-for-static-content-in-webrick-and-mongrel/69969/3 "2006-09-26T17:12:21Z")

</div>

Vish,

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  
though.

Wes
