title: AMP form problems (very slow)
body: <p>When clicking send the form is taking upto 30 seconds to send.</p>
  
  <p>The form is working, it does send eventually.</p>
  
  <p>If I inspect the page and view network to try and see what is going on it sends instantly as expected. When viewing the page normally it is really slow.</p>
  
  <p>I have no idea what would be causing this? Does anyone else have a similar issue?</p>
  
  <p>I have contacted my hosting company to confirm the issue is my end rather than a server issue.</p>
  
  <p>HTML</p>
  
  <pre><code>&lt;form method="post" action-xhr="send-form.php"&gt;
  Your name:&lt;br&gt;
             &lt;input type="text" name="namee" required  /&gt;
             Your telephone number:&lt;br&gt;
              &lt;input type="text" name="phone" required /&gt;
              Your email address:&lt;br&gt;
             &lt;input type="text" name="email" required /&gt;
             Your message:&lt;br&gt;
             &lt;textarea name="message"&gt;&lt;/textarea&gt;
  
              &lt;input type="submit" class="imgcenter" value="" background-image: url(https://www.example.co.uk/img/send.png);"/&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>PHP</p>
  
  <pre><code>&lt;?php
  if( !empty($_POST) ){
  
      $email = $_POST['email'];
      $namee = $_POST['namee'];
      $phone = $_POST['phone'];
      $message = $_POST['message'];
  
      $formcontent=" From: $email" . "$namee" . "$phone" . "$message";
      $recipient = "hello@example.co.uk";
      $subject = "Enquiry";
      $mailheader = "From: $email \r\n";
      mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
  
      $domain_url = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]";
      $redirect_url = 'https://www.example.co.uk/thanks.html'; //--&gt;MUST BE 'https://';
  
      header("Content-type: application/json");
      header("Access-Control-Allow-Credentials: true");
      header("Access-Control-Allow-Origin: *.ampproject.org");
      header("AMP-Access-Control-Allow-Source-Origin: ".$domain_url);
  
  
          if( empty($redirect_url) ){
              header("Access-Control-Expose-Headers: AMP-Access-Control-Allow-Source-Origin");
          }else{
              header("AMP-Redirect-To: ".$redirect_url);
              header("Access-Control-Expose-Headers: AMP-Redirect-To, AMP-Access-Control-Allow-Source-Origin");
          }     
  }
  ?&gt;
  </code></pre>