title: How to call microservice without slowing down the response?
body: <p>I want to integrate a new functionality with a Laravel based ecommerce solution. At this point the main scripts takes around 2.7s to run. The whole site loads in above 6s and we've just started to monitor it. The goal is to get below 2s with script and 4s with everything.</p>
  
  <p>The microservice and the functionality is exposed through a gRPC.</p>
  
  <p>There is a TLS based client-server authentication in place (ecommerce instances and my service can prove who they are). This eats few milliseconds.</p>
  
  <p>When testing Go-client and Go-server, with a pool of 20 connections, it achieved below 35ms per requests. 
  In PHP each request takes above 200ms.</p>
  
  <p>Is it possible to:</p>
  
  <ol>
  <li>cache the connection to service between requests?</li>
  <li>call RPC methods asynchronously?</li>
  </ol>
  
  <p>Among other solutions I'm considering:</p>
  
  <ol>
  <li>Setting up a local gRPC proxy which will accept only localhost GET requests made by PHP script and make them a secure gRPC calls.</li>
  <li>Setting up a proxy in front of PHP application to call microservice.</li>
  <li>Calling a service directly from website with JavaScript (puts a burden on a users browser, need to maintain JavaScript).</li>
  </ol>
  
  <p>Any suggestions?</p>