开发者

What's the impact of not compressing javascript and CSS on client side processing

Ignoring download times, what's the performance impact of making the browser interpret several separate small files as opp开发者_JAVA技巧osed to one big one. In particular, could it make a significant difference to page rendering speed in ie6 and 7?


Browsers typically limit themselves to a certain number of simultaneous requests. This number is dependent on how "server friendly" they are.

How many concurrent AJAX (XmlHttpRequest) requests are allowed in popular browsers?

So, depending on the number of artifacts the browser has to load, it may have to wait for others to complete first. Artifacts include everything the browser has to go back to the server for: images, javascript, css, flash, etc. Even the favicon if you have one.

That aside, rendering speed is normally going to boil down to how the pages are structured. ie. how many calculations you depend on the browser to make (% width vs fixed width).


It has to make more round-trip HTTP requests. It may or may not have significant consequences.


Where,

Apart from download times , if you too have many javascript and css files

Each request is as an extra http call from client to server.

If the page load is one of the main criteria you should definetly think about it

read this doc also

http://developer.yahoo.com/performance/rules.html


I work for a gov't organization with a large scale enterprise intranet and when we had around 25+ JS files and 10+ CSS files loading on our intranet portal we did notice a dramatic lag in page load time in IE6 and 7. Newer browsers have faster routines for loading and executing JavaScript. I used YUI Compressor to minify everything including CSS.


If you include minification in along with combining files, then dead code often gets removed (depending on the minifier) and some code can be optimized (see YUI Compressor: What are micro optimizations? and Which javascript minification library produces better results?).


I've asked this question a bunch of times when I first started out with web development.

If you have under 10 javascripts and 10 css files (css not so important in my opinion), then I don't think there is much use minifying and compressing. However, if you are dealing with a bunch of javascript files (greater than 10), then YES, it's gonna make a difference.

What you may experience is, even after compressing and minifying and combining your scripts, you may still experience slow-ness. That's when HTML caching plays a huge role in website optimizations, at least that's what I experienced in my web application. Try looking into Memcached and use it to cache your html files. This technique speeds up your web application a WHOLE LOT!!!

I am assuming your question is related to web optimization and high performance websites.

Just my 2 cents.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜