Javascript Parsing Performance?

This Comment will be submitted for moderation and will not be accessible to other users until it has been approved.


6 points

I am trying to improve the performance of a web application. I am using YSlow and one key thing it suggests me to minimize external CSS and Javascript files for performance.

These CSS and Javascript files are served statically for each page. My concern is that the browser has to parse these CSS and Javascript files for each page. Should I compress all the CSS and Javascript files for all pages into one or should I compress separately the files for all the pages and load them separately? Any ideas?



-5 points

It always make sense to compress your javascript files into bunch of them and them load them. For some browsers, the larger javascript parsing may take more time than 2 smaller javascript files and therfore, remove all comments and spaces from your javascript files (using tool like http://www.refresh-sf.com/yui/) and then compress multiple files into bunch of javascript files for fast performance.

Anonymous's picture
Created by Anonymous

Post Comment

  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.