# Rails and ySlow

**URL:** <https://www.ruby-forum.com/t/rails-and-yslow/115401>\
**Category:** Rails\
**Created:** [September 24, 2007, 10:38pm UTC](https://www.ruby-forum.com/t/rails-and-yslow/115401 "2007-09-24T22:38:23Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![eddiewould](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b5e925/32.png) [@eddiewould](https://www.ruby-forum.com/u/eddiewould)\
**Post date:** [September 24, 2007, 10:38pm UTC](https://www.ruby-forum.com/t/rails-and-yslow/115401/1 "2007-09-24T22:38:23Z")

</div>

If anyone has followed Steve Soulder’s tips on optimizing web  
performance (Yahoo chief performance guy), his most important rule of  
thumb could be deadly to your rails app.

My first blog post:  
[http://www.dominicson.com/web-2-0](http://www.dominicson.com/web-2-0)

Dominic

---

<div class="post-metadata">

**Author:** ![eddiewould](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b5e925/32.png) [@eddiewould](https://www.ruby-forum.com/u/eddiewould)\
**Post date:** [September 25, 2007, 3:06am UTC](https://www.ruby-forum.com/t/rails-and-yslow/115401/2 "2007-09-25T03:06:54Z")

</div>

All my scripts and css are compress, merged and then gzipped and  
served from s3. This is all done via a task each time I deploy my app.

I don’t have any problems with it. What are the problems, i don’t  
understand?

On Sep 24, 1:38 pm, Dominic S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![eddiewould](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b5e925/32.png) [@eddiewould](https://www.ruby-forum.com/u/eddiewould)\
**Post date:** [September 25, 2007, 5:14am UTC](https://www.ruby-forum.com/t/rails-and-yslow/115401/3 "2007-09-25T05:14:38Z")

</div>

I thought it was fine also. Logs seemed active. Then users started  
complaining. Then I checked on as many computers that my js would load  
correctly. out of 5 computers, each running both IE and FF, one of them  
would fail to load the js correctly.

I’m just not going to take the risk…

eggie5 wrote:

> All my scripts and css are compress, merged and then gzipped and  
> served from s3. This is all done via a task each time I deploy my app.
> 
> I don’t have any problems with it. What are the problems, i don’t  
> understand?
> 
> On Sep 24, 1:38 pm, Dominic S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![eddiewould](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b5e925/32.png) [@eddiewould](https://www.ruby-forum.com/u/eddiewould)\
**Post date:** [September 25, 2007, 6:15am UTC](https://www.ruby-forum.com/t/rails-and-yslow/115401/4 "2007-09-25T06:15:11Z")

</div>

Oh, so it’s a compressor issue. A lot of the compressors I was  
experimenting with produced bad JS, especially with more advanced JS.  
The compressed js is also prone to errors just because of the fact  
that javascript is such a flexible language (not rigid in it’s  
syntax).

It’s not hard to try out the results in all the browser/os  
combinations or FF/IE/S on windows/osx. It just seems like what you’re  
saying is a cop-out.

Anyways, I suggest using dojo compressor.

On Sep 24, 8:14 pm, Dominic S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![eddiewould](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b5e925/32.png) [@eddiewould](https://www.ruby-forum.com/u/eddiewould)\
**Post date:** [September 25, 2007, 11:59pm UTC](https://www.ruby-forum.com/t/rails-and-yslow/115401/5 "2007-09-25T23:59:38Z")

</div>

When my deploy script runs, just builds the string path for the css  
file and inserts it into the rhtml page as html.

---

<div class="post-metadata">

**Author:** ![eddiewould](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b5e925/32.png) [@eddiewould](https://www.ruby-forum.com/u/eddiewould)\
**Post date:** [September 25, 2007, 5:49pm UTC](https://www.ruby-forum.com/t/rails-and-yslow/115401/6 "2007-09-25T17:49:00Z")

</div>

Eggie5, you mention serving your css and js files from S3. I tried  
that before and it really slowed my site down. I served it by setting  
config.action\_controller.asset\_host = my.s3.bucket in config/  
environment/production.rb. How are you serving these files?

---

<div class="post-metadata">

**Author:** ![eddiewould](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b5e925/32.png) [@eddiewould](https://www.ruby-forum.com/u/eddiewould)\
**Post date:** [September 26, 2007, 7:34am UTC](https://www.ruby-forum.com/t/rails-and-yslow/115401/7 "2007-09-26T07:34:56Z")

</div>

OH, and it’s also CRITICAL that when you upload the files to s3 that  
you set the content-types to text/javascript and text/css respectively  
or else when they’re severed they will be ignored by in certain  
circumstances.

On Sep 24, 8:14 pm, Dominic S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
