Reputation: 61
I am working on minify and uglify my javascript files. I am wondering how big the proper size is. If I combine all js files into a file (with minifying and uglifying), it is bigger than 1mb. I guess, it's better to chop them into 2-3 files (200kb-300kb for each) instead of one big file (1mb).
Can anyone give a suggestion? like 100kb ~ 300kb or 1mb ~ 2mb
============ additional comment ============
I am using Django(Backend) & angularJS (Frontend). as far as I know, all js files for angularJS should be sent to user when index(root html file) html file sent. That's why the Concatenated js files (including external js file such as jquery, bootstrap, angular, media player and etc...) is more than 1mb.
Upvotes: 0
Views: 2551
Reputation: 1
When using tools like Webpack the maximum suggested file size is 244 KB
but as others mentioned, it depends on the project and there is no exact answer.
Upvotes: 0
Reputation: 4782
There is no correct answer for your question. Some recommendations, since you have a large app to load:
Upvotes: 1
Reputation: 19792
There is no one proper size. The less bytes the better, but it depends on your code base it order to determine how small you can realistically get. The bigger the file, the greater network latency retrieving the files (so, this will impact the user more negatively). So if you had to come up with a general "rule", the smaller the better.
Upvotes: 1