Sunday, 15 August 2010

javascript - Optimising js for production - Lots of small or one large js file -



javascript - Optimising js for production - Lots of small or one large js file -

i have angularjs app, looking optimise speed.

i uglifying , concatenating bower_components require vendor.js file.

i uglifying , concatenating custom js scripts.js file.

as such, when user downloads page, there few resources in request. (presently 6 in total without image assets). disadvantage have 2 large-ish js documents download - half megabyte in total - entire doc needs downloaded before page rendering can done.

my main concern vendor.js file. improve utilize cdn provided, minified javascript files (approx 10 in total), or improve utilize concatenated & uglified vendor.js?

the former mean total resources increment 16 without image assets, served different vendor provided cdn networks, allowing parallel downloading.

even though former allow parallel downloading, 16 different tcp connections http embedded, 16 http headers sent too. tcp bit costly open new connections. think might improve agglomerate in 1 file.

what anyway test both case , see @ network developer tools of favourite web browser see, in average, fastest way. @ to the lowest degree doable firefox.

javascript single-page-application production-environment uglifyjs

No comments:

Post a Comment