0

Before you respond, yes, I've read this post.

The difference in my question is that I'm not looking for best practice, or internet speed considerations, so much as the actual maximum browsers (or each browser if you wish to, or have to, be specific) can handle before they crash, and also how big of a file the php engine can handle before it crashes.

The reason being is I'm building a online job application for a company I work for, and I have lots of necessary JavaScript validation (though, I put what I could in external js files) to prevent SPAM & abuse. I also have PHP intertwined with JavaScript to test if PHP is active, if not it falls back to JavaScript functions. I also have jQuery, MooTools, and more like such... Not to mention all the required questions, textbox's, dropdown's, radio buttons, check boxes, and textarea's.

The problem is that I've only completed one section of the online application and my file is already at 32 KB. Considering the amount of work I've done, and what I have left to do, I can see this html/php (.php) file easly reaching 200KB+

So I need to know the true maximum limit to both the typical HTML browser and server-side PHP engine.

Thanks in advance,

-James

Community
  • 1
  • 1
James Anderson Jr.
  • 760
  • 1
  • 8
  • 26
  • 2
    Impossible to say. What if you're running your browser on an 8086-4.77MHz with 640k of ram? That's definitely going to have a SOMEWHAT lower size limit than a Core i7 with 32gig. Ditto for servers. A dinky "free" VPS with a couple gigs vram isn't going to be handling as much as a massive multi-socket ram-out-the-wazoo monster physical box. – Marc B Oct 15 '13 at 21:33
  • In general when you start hitting the limit, the people using the site get bored waiting for the page to load and go somewhere else, so in way it doesn't matter at the client end. You should break the thing up anyway, sections or something. – Tony Hopkinson Oct 15 '13 at 21:42

3 Answers3

2

I cannot foresee a modern browser or server 'choking' on 200KB of HTML or PHP respectively. Large PHP apps verge into the Megabytes and I've seen pages with Megabytes of markup.

The issue here is more code organization. If you're putting that much code in a single file, something is probably wrong. Consider splitting up your code using something as primitive as PHP's include() function or something as comparatively revolutionary as writing your code on one of the many MVC frameworks that are out there.

phil-lavin
  • 1,187
  • 7
  • 19
1

This depends entirely on the computer that is browsing the site. On a reasonably modern PC you should be able to have your script puke out several megabytes before the browser beings experiencing issues, and these are usually only delays in rendering the page.

In a previous job I was working on a single-core 1.lownumber GHz Celeron machine [more recently than you might imagine] with WinXP and 1.5GB of RAM. I was implementing a spam filtering product that was not designed with handling 10,000+ domains and, as a result, was spitting out pages with over 8MB of markup. The browser received the page just fine, threw no error, but took a few minutes to display the page.

When I got a new dual-core Win7 machine a year or so later the delay was barely even noticeable.

That said, 400KB of data per page isn't terrible, but it's not that great either. I would be more concerned with the load placed on the server to generate that much markup, and the load placed on the network to deliver it. You should consider ways to cut down on the volume of data you send with each request [pagination, AJAX] and re-evaluate just how much data the user really needs to see in each request.

Sammitch
  • 30,782
  • 7
  • 50
  • 77
  • I've seen online job applications that use multiple pages, but I didn't want to go that route because 1.) I'm loading this page in an iFrame, and 2.) I want the user to be able to complete the whole application on a single page and submit it. – James Anderson Jr. Oct 15 '13 at 22:08
0

-> This is the important bit.

Do not rely on Javascript to prevent spam/abuse/invalid data and the rest. It only enables one to provide a more pleasure user experience. Thats it.

Use the PHP scripts etc. to ensure appropriate data is stored on the server.

That is your asset and also people can turn JavaScript off/fire anything to you.

-> You server side is open for debate as to the number of hits. Just monitor the traffic

Ed Heal
  • 59,252
  • 17
  • 87
  • 127