Skip to content Skip to sidebar Skip to footer

Duplicate Javascript And Css Includes

I have a question regarding the javascript includes and css includes. What happens if we included the same css or javascript files two times by different developers? http://example

Solution 1:

Duplicate JavaScript and CSS files hurt performance by creating unnecessary HTTP requests (IE only) and wasted JavaScript execution (IE and Firefox).

In IE, if an external script is included twice and is not cacheable, it generates two HTTP requests during page loading. Even if the script is cacheable, extra HTTP requests occur when the user reloads the page.

In both IE and Firefox, duplicate JavaScript scripts cause wasted time evaluating the same scripts more than once.

This redundant script execution happens regardless of whether the script is cacheable.


For more information about how to make web site load faster, refer to this really good article.

I have pasted the info about duplicate JavaScript and CSS, here in the answer above.

Solution 2:

For CSS, the duplication will mean that twice the selector matching will have to be done, and for rules that match they will match twice, so the time to do style computation will be longer too.

Post a Comment for "Duplicate Javascript And Css Includes"