title: Fastest way for a HTML page to redirect to a script
body: <p><strong>I am looking for fast methods/ways I can redirect a HTML page to another page.</strong></p>
  
  <p>Currently I use meta-tags to redirect a HTML page to a python script that grabs the website HTML from a SQL database(grabs different HTML based on whether user is on a Mobile device) then sends that HTML back. But this is visibly slow, it shows a blank white page(redirect HTML page) then shows the python script page.</p>
  
  <p><em>I know that its not the python script thats slow because if I just go straight to the python script(no redirect from the HTML page) then it loads very fast &amp; with no white screen.</em></p>
  
  <p>So for example; someone accesses <a href="http://mywebsite.com/contactUs.html" rel="noreferrer">http://mywebsite.com/contactUs.html</a> which contains only the following HTML:</p>
  
  <pre><code>&lt;HTML&gt; &lt;HEAD&gt;&lt;META HTTP-EQUIV=Refresh CONTENT="0; url=cgi-bin/loadWebPage.py?webpage=50002"&gt;  &lt;/HEAD&gt; &lt;/HTML&gt; 
  &lt;!-- This redirects to my python script that grabs the contact us HTML &amp; prints it out(shows the webpage HTML) --&gt;
  </code></pre>
  
  <p>Are there other ways a HTML file can redirect to a python script that will be faster?</p>
  
  <p>Maybe I can use HTTP messages? Would the following text/code work in a HTML file?:</p>
  
  <pre><code>Status: 301 Moved"
  Location:/cgi-bin/loadWebPage.py?webpage=50002
  </code></pre>
  
  <p>Would my last resort be AJAX or javascript to get the fastest result?</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  
      &lt;script type="text/javascript"&gt;
      &lt;!--
          window.location = 'http://mywebsite.com/cgi-bin/loadWebpage.py?webPage=50001';
      --&gt;
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>