title: Generate Javascript file with PHP
body: <h1>My current code</h1>
  
  <p>I have started writing an API that loads, minifies and returns javascript files into one file using PHP. This is achieved by pointing to a PHP file from a <code>script</code> tag in HMTL like so:</p>
  
  <pre><code>&lt;script type="text/javascript" src="https://libraries.sinemaculammviii.com/jsapi.php"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>This <code>jsapi.php</code> page processes the javascript files and outputs the minified javascript, with the header:</p>
  
  <pre><code>header("Content-Type: text/javascript");
  </code></pre>
  
  <h1>My Question</h1>
  
  <p>Is this a bad method to load javascript files? Would it be <strong>much</strong> faster and reliable to load the javascript files individually by simply pointing to the <code>.js</code> file in the <code>src</code> attribute?</p>
  
  <p>If you wish to see my code for the the full API, have a look at <a href="https://codereview.stackexchange.com/questions/18117/loading-javascript-libraries-with-php-api">this</a>. The mentioned link also explains in detail what it is I am doing and why.</p>