Is there a maximum size limit for an HTML page?

Asked

Viewed 1,859 times

5

Note: This question is not on code optimization.

It is known that browsers have a size limit for a URI. There is some kind of limit for requesting/rendering an HTML file?

Giving a simple example, let’s say that an HTML page generated on the server, by some bug or query error, returns a table with millions of rows and several columns. Such a page (with hundreds or thousands of Megabytes) would have its rendering blocked by the browser, or it is solely dependent on the number of hardware resources on which the browser is running?

  • 3

    one of the two sides will crash.. or the server or the client.. A slightly more loaded server will surely give some problem. But usually the client will give crash too. Browsers usually crash after about 60 or 80mb, but usually the client already hangs well before that.

2 answers

2

There is no limit in the HTML pattern to the maximum size it can have. It would make no sense to limit what a browser can endure until, because if the browser could cross that limit, you can be sure it would not be a default that would make it refuse to accept the page.

Just look at how supportive browsers are of error-prone Htmls. If a browser refuses to open the page that has an error and another browser accepts it (even if it is not a perfect view), it loses a user. The same would be true here.

In general, standards are limited to requiring a minimum of functionality and not to dictating a maximum.

2

No limits imposed by default, however limits exist, either on the server or client side.

You can use a loop loop to generate something very large and complex for the browser to render, in addition to overloading your server, which can also crash, will reach a point where the browser will not be able to render satisfactorily and will crash, by processing or using memory, remember that computers do not have infinite memory, however much they have memory left over nowadays.

It’s like an infinite scroll page. You will notice that each scroll gets heavier, it can take a little bit according to your machine, and if you want to see clear results load an image each scroll.

For any bug or query error, return a table with millions of rows and multiple columns.

Most programmers treat this error so that it does not happen, most of the time it comes to logic error, which can be fixed or detected simply by doing tests.

While the query returns results endlessly, they will not be displayed, just finish the execution and print the result (or if you do something dynamic to display while doing the queries). In PHP for example, you can limit the running time of a script, if it goes into infinite loop, it would stop the execution.

For the most part, when an infinite loop occurs and you have no treatment to prevent it, the customer receives a 500 error.

While on the client side, when the server (in a very unlikely situation) manages to run and return something absurd, they usually hang on an average of 90 MB, some still manage to display, but they take a long time in processing.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.