title: Azure web app slow server response time
body: <p>I have Basic (Small) tier Azure Web App hosted in West Europe with a Basic SQL Database in the same region. Always On is turned on. Note that my website's target audience is in Europe.</p>
  
  <p>Note that the website is <code>CodeIgniter</code> based and runs on <code>php 5.6</code>.</p>
  
  <p>The page loads really slowly, even though on local environment everything is fast. After running <a href="https://developers.google.com/speed/pagespeed/insights/" rel="nofollow noreferrer">PageSpeed Insights</a> on my site I get the following assessment: </p>
  
  <blockquote>
    <p>Reduce server response time
    In our test, your server responded in 1.7 seconds. There are many factors that can slow down your server response time. Please read our recommendations to learn how you can monitor and measure where your server is spending the most time.</p>
  </blockquote>
  
  <p>When inspecting the site from <code>developer tools</code>I get a similar picture:
  <a href="https://i.stack.imgur.com/qT6Zm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qT6Zm.png" alt="enter image description here"></a></p>
  
  <p>As you can see the initial response is really bad. What could be the problem? </p>
  
  <p><strong>UPDATE/SOLUTION</strong></p>
  
  <p>Taking the advice of <a href="https://stackoverflow.com/users/4989668/gary-liu-msft">Gary Liu - MSFT</a>'s from the comments, namely enabling <code>pconnect</code> in the <code>database.php</code> the load time of the page went down to <code>0.23</code> seconds, that is an <strong>~8x</strong> improvement.</p>