Is there a maximum size limit for an HTML page?

5
  

Note: This question is not about code optimization.

It is well known that browsers have a size limit for a URI. Is there any kind of limit for requesting / rendering an HTML file?

Given a simple example, let's say an HTML page generated on the server, for some bug or query error, returns a table with millions of rows and multiple columns. Would such a page (hundreds or thousands of megabytes) have its rendering blocked by the browser, or is it solely dependent on the number of hardware resources the browser is running on?

    
asked by anonymous 28.12.2015 / 09:08

2 answers

2

There is no limit to the HTML standard for the maximum size it can have. It would not make sense to limit what a browser can hold up to because if the browser managed to exceed that limit, you can be sure it would not be a default that would make you refuse to accept the page.

Just look at how browsers are sympathetic with HTMLs that have errors. If a browser refuses to open the page that has an error and another browser accepts it (even if it is not a perfect display), it loses a user. The same would apply here.

In general, standards simply require a minimum of functionality and not dictate a maximum.

    
28.12.2015 / 11:36
2

Limits imposed by default, but limits exist , be they server-side or client-side.

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

It's like an infinite scroll page. You will notice that each scroll is heavier, it may take a little longer depending on your machine, and if you want to see clear results, load an image with each scroll.

  

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

Most programmers handle this error so that this does not happen, most often it is logic error, which can be fixed or detected by simply testing.

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

For the most part, when an infinite loop occurs and you have no treatment to prevent this, the client gets a 500 error.

While on the client side, when the server (in a very unlikely situation) can execute and return something absurd, they usually crash on average 90 MB, some still manage to display, but they take a long time to process.     

28.12.2015 / 11:57