# Css serving slow?

**URL:** <https://www.ruby-forum.com/t/css-serving-slow/105845>\
**Category:** Rails\
**Created:** [June 3, 2007, 7:20pm UTC](https://www.ruby-forum.com/t/css-serving-slow/105845 "2007-06-03T19:20:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![andreim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c2a13f/32.png) [@andreim](https://www.ruby-forum.com/u/andreim)\
**Post date:** [June 3, 2007, 7:20pm UTC](https://www.ruby-forum.com/t/css-serving-slow/105845/1 "2007-06-03T19:20:36Z")

</div>

I’m using WEBrick (in development mode) to serve a very simple page.  
The browser receives from the server two things:

1. the html
2. a css file  
What’s strange is that it takes the server almost ten times longer to  
send the css file than it takes it to send the html (11ms for the  
html, 120 ms for the css). Both files are about the same size.  
What’s going on?  
Why is serving css so much more expensive than rhtmls?  
Thanks!!

–andrei

ps: i tried putting the css inside the html and the response time is  
the same as for a normal html. so it’s clearly not a size issue.

---

<div class="post-metadata">

**Author:** ![andreim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c2a13f/32.png) [@andreim](https://www.ruby-forum.com/u/andreim)\
**Post date:** [June 3, 2007, 8:23pm UTC](https://www.ruby-forum.com/t/css-serving-slow/105845/2 "2007-06-03T20:23:43Z")

</div>

mongrel outperforms webrick by all means. just get rid of webrick.

---

<div class="post-metadata">

**Author:** ![andreim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c2a13f/32.png) [@andreim](https://www.ruby-forum.com/u/andreim)\
**Post date:** [June 3, 2007, 7:25pm UTC](https://www.ruby-forum.com/t/css-serving-slow/105845/3 "2007-06-03T19:25:07Z")

</div>

andreim wrote:

> I’m using WEBrick (in development mode) to serve a very simple page.  
> The browser receives from the server two things:
> 
> 1. the html
> 2. a css file  
> What’s strange is that it takes the server almost ten times longer to  
> send the css file than it takes it to send the html (11ms for the  
> html, 120 ms for the css). Both files are about the same size.  
> What’s going on?  
> Why is serving css so much more expensive than rhtmls?  
> Thanks!!
> 
> –andrei
> 
> ps: i tried putting the css inside the html and the response time is  
> the same as for a normal html. so it’s clearly not a size issue.

For those times, I really wouldn’t worry about it. Running Webrick in  
dev mode is supposed to be slow. If you are getting the same results in  
an Apache/Mogrel production environment then it might be with further  
investigation.

---

<div class="post-metadata">

**Author:** ![andreim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c2a13f/32.png) [@andreim](https://www.ruby-forum.com/u/andreim)\
**Post date:** [June 4, 2007, 1:28am UTC](https://www.ruby-forum.com/t/css-serving-slow/105845/4 "2007-06-04T01:28:17Z")

</div>

On 6/3/07, liquidautumn [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> mongrel outperforms webrick by all means. just get rid of webrick.

On another note, if webrick, mongrel, or anything else ruby based is  
serving css or other static assets, you should rethink things and let  
nginx/lighttpd/apache deal with it.

–  
Rick O.  
[http://lighthouseapp.com](http://lighthouseapp.com)  
[http://weblog.techno-weenie.net](http://weblog.techno-weenie.net)  
[http://mephistoblog.com](http://mephistoblog.com)

---

<div class="post-metadata">

**Author:** ![andreim](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c2a13f/32.png) [@andreim](https://www.ruby-forum.com/u/andreim)\
**Post date:** [June 4, 2007, 5:28am UTC](https://www.ruby-forum.com/t/css-serving-slow/105845/5 "2007-06-04T05:28:32Z")

</div>

me personally developing with apache proxying to mongrel (because of  
mod\_xsendfile used), however I think such setup is pretty rare for  
development environment  
in production - no doubt.  
just wondering why people keep suffering with webrick, while in recent  
rails script/server starting mongrel by default.
