9

Engineering incredibly large webapps, do we have any top or limit or best practice for filesizes in these large projects? The biggest I have seen is probably twitter/gmail which had around 1mb (Minified) javascript - but how much can a browser handle?

What if there is a large app with 5mb, 10mb or 100mb javascript minified? When does it severely affect performance or memory usage (Even if the app is very well written and optimized) - can the jit handler take whatever? Are there any diminishing returns?

Is there any real example of apps beeing this big, except for the usual suspects such as gmail, twitter, facebook, googledocs, etc.

Thanks!

neph
  • 733
  • 1
  • 8
  • 16

1 Answers1

5

As far as I know there is now such limit for JavaScript files, nor is there a limit at all for files of all kinds.

The only limit is the system you are running the web app on:

The browser will consume as much CPU and RAM as it needs to handle your web app. The internet connection is a bottleneck, too.

Although a web application can grow to a quite big size, there is no such real (productive used) example of an application serving JavaScript files up to 100 MB in size - I mean, think about it, 100 MB size for a JavaScript file (!), nobody would visit the page, stay on the page and wait till the download of the JavaScript files is finished and the browser's JavaScript engine processed this file.

But feel free to try write a JavaScript file which is 100 MB in size which does several tasks such as doing a console.log() a thousand times and report it here to us what happened then.


Some nostalgy: I found this bug report from Mozilla, it's nearly 13 years old.

akluth
  • 8,393
  • 5
  • 38
  • 42
  • "nor is there a limit at all for files of all kinds.". For your knowledge: http://blogs.telerik.com/aspnetmvcteam/posts/10-05-03/internet-explorer-css-limits.aspx and http://joshua.perina.com/africa/gambia/fajara/post/internet-explorer-css-file-size-limit - There are limits for CSS: Size, Selectors and # of files. – RaphaelDDL May 02 '13 at 18:17
  • 1
    That CSS limit is a real bitch, we had discovered this IE limitation a couple years back, we had to LITERALLY import ALL the css rules for one of our products into javascript, that was a fun night... – Hank Mar 18 '15 at 21:37
  • Ah yep, i had the issue with IE8 css file size restriction too. It doesn't processed file content starting from part that exceed 150kb. Was trying to understand why some styles not applied. – Rantiev Apr 30 '17 at 11:22
  • An interesting use case is when you want to store a dataset in a javascript file, and let the user process that data in the browser. In those cases a javascript of 100 MB is not at all strange. Here is one of 50 MB, and it loads quickly: https://annotation.github.io/app-nena/phono.html – Dirk Roorda May 06 '21 at 18:22