Requesting long PHP scripts with AJAX
<p>I'm building a website which loads dynamically from a SQL database. To do that, I've created a PHP file that handles ALL AJAX and Post and Get requests (and every page has a couple of <code>php include</code>). </p>

<p>The PHP is not very long yet (250 lines), but it could get much longer eventually.
Everything is wrapped in <code>&lt;?php **** ?&gt;</code> tags, and is clearly and methodically composed of <code>switch</code> and <code>case</code>. So I only need a couple of lines each time.</p>

<p>My question is: Does <em>every</em> <code>include</code> request load/download <em>all</em> the file, or just the corresponding part? Rephrasing, will a hypothetically 10,000 line long script slow down <em>the browser</em>, or just the response time from the server?</p>

<p>I have concerns about all this.</p>

<p>Thanks in advance.</p>

<p>PS: This idea of unifying <code>sql</code> requests comes from a computer engineer friend that's always insisting on <a href="http://en.wikipedia.org/wiki/Multitier_architecture" rel="nofollow">Multititer Architecture</a>.</p>
