views:

93

answers:

3

I'm trying to figure out how much javascript is being loaded on my website. I'm using Reducisaurus to shrink my js files. The problem is, this is causing both YSlow and the Web Developer extension report the size of my files as ~.04K, which I know can't be right (one of the .js files is jquery, which is 50kb). Is there any way to accurately figure out how much time I've saving by using Reducisaurus?

A: 

Figuring this out manually wouldn't too hard in this case.

  1. Determine the average net speed of your users (you should do this anyway).
  2. Determine (based on that speed) how long it would take to load a file the size of the large file.
  3. Determine (based on that speed) how long it would take to load a file the size of the small file.
  4. Subtract.
Gabriel McAdams
A: 

So rather than send the JS file straight to the user's browser, you instead send it to another web server, wait for it to "compress" it and then send the results of that compression to the user for you? I can't imagine that saving any time at all, and if the service goes down, your site stops working.

Unless I'm misunderstanding this service you're using, I'd say mod_deflate would be infinitely more useful.

Azeem.Butt
I had the same question, which is why I was curious to test Reducisaurus.
Goose Bumper
I don't think you need to do any testing to figure out that sending the file twice is not going to be faster than sending it once.
Azeem.Butt
-1, I'm sorry, but you really are misunderstanding.
Alix Axel
+1  A: 

Actually @Azeem.Butt is way wrong, at least partially.


A non-Reducisaurus scenario:

  1. User A goes to your Website
  2. User A requests the CSS / JS
  3. Your host serves the unminified requested CSS / JS
  4. User B goes to your Website
  5. User B requests the CSS / JS
  6. Your host serves the unminified requested CSS / JS

A Reducisaurus scenario:

  1. User A goes to your Website
  2. User A requests the CSS / JS from reducisaurus.appspot.com
  3. reducisaurus.appspot.com requests the CSS / JS from your host
  4. reducisaurus.appspot.com minifies, caches (expire_urls and max-age) and serves the CSS / JS
  5. User B goes to your Website
  6. User B requests the CSS / JS from reducisaurus.appspot.com
  7. reducisaurus.appspot.com serves the cached CSS / JS

So, by using Reducisaurus you're not only minifying the content, you're also serving only one request per each x seconds, where x it's the number of seconds you've defined for the cache to live (default is 600 seconds = 10 minutes). Also, since it's not your web server that its serving the files it will reduce the workload and theoretically, be even faster. The minification only happens once per TTL.

There are other things to consider that could make Reducisaurus even more appealing, such as a CDN.

The thing that worries me about Reducisaurus is it's reliability, since it's free anyone can exploit it and thus render the whole service useless, other than that it's a great idea / service.


jQuery

46.401 bytes (45.31 KB):
http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js

jQuery & Google Minification

24.678 bytes (24.10 KB) - 46.82% smaller:
http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js

jQuery & Reducisaurus Minification

26.325 bytes (25.71 KB) - 43.20% smaller:
http://reducisaurus.appspot.com/js?url=http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js
Alix Axel
+1 Just because it is called minification does not mean smaller file size.
Christopher Altman
@Christopher: Thanks, but... I don't get it (I must be sleepy). What do you mean by that?
Alix Axel