Is there a maximum javascript file size that browsers can handle?

Creating incredibly large webapps, do we have any peaks, limits or best practices for files in these large projects? The biggest thing I saw was probably twitter / gmail, which had about 1 mb (miniature) javascript, but how much could the browser handle?

What if there is a large application with 5mb, 10mb or 100mb javascript? When it greatly affects performance or memory usage (even if the application is very well written and optimized) - can the jit handler take anything? Are there any diminishing results?

Is there any real-world example of apps that are so big, except for the usual suspects like gmail, twitter, facebook, googledocs, etc.

Thanks!

+6
source share
1 answer

As far as I know, there is currently such a limit for JavaScript files, and there are no restrictions for files of all kinds.

The only limitation is the system on which the web application is running:

The browser will consume as much CPU and RAM as it needs to work with your web application. Internet connection is also a bottleneck.

Although a web application can grow to a fairly large size, there is no real (productive) example of an application that supports JavaScript files up to 100 MB in size. I mean, think about it, the size is 100 MB for a JavaScript file (!), No one will visit the page, stay on the page and wait for the JavaScript files to load and the JavaScript browser handler will process this file.

But feel free to write a 100 MB JavaScript file that performs several tasks, for example, doing console.log() thousand times and tell us what happened next.


Some nostalgia: I found this one from Mozilla, he's almost 13 years old.

+3
source

All Articles