Imagine you're working on a massive javascript-powered web application with minimal page refreshes in mind, containing around 80-100MB of unminified javascript to give an idea of its scale.
The theory is that by lazy-loading your javascript files, you can strike a better balance in load times, eliminating the wait time during page refreshes. In this scenario, lazy-loading may be more preferable than simply using a single minified .js
file.
In theory, there's a fixed cost for requesting any file from a server regardless of its size. Therefore, excessive requests are not ideal. For instance, if a small javascript file loads alongside 10 other similarly sized files, it might be more efficient to group them together and save on multiple request costs.
So here's my query: Assuming reasonable defaults (let's say the client has a 3-5Mbps connection and decent hardware), what would be the optimal size for a file to request? Go too big, and you risk overloading the system; go too small, and the request cost might exceed the data being received, impacting data per second efficiency.
Edit: All the responses were great, but I picked Ben's as he provided a specific number.