title: Apache, PHP caching
body: <p>A have setup an internal proxy kind of thing using Curl and PHP. The setup is like this:</p>
  
  <p>The proxy server is a rather cheap VPS (which has slow disk i/o at times). All requests to this server are handled by a single index.php script. The index.php fetches data from another, fast server and displays to the user.</p>
  
  <p>The data transfer between the two servers is very fast and the bottleneck is only the disk i/o  on the proxy server. Since there is only one index.php - I want to know </p>
  
  <p>1) How do I ensure that index.php is permanently "cahced" in Apache on the proxy server? (Googling for php cache, I found many custom solutions that will cache the "data" output by php I want to know if there are any pre-build modules in apache that will cache the php-script itself?).</p>
  
  <p>2) Is the data fetched from the backend server alway in the RAM/cache on the proxy  server? (assuming there is enough memory) </p>
  
  <p>3) Does apache read any config files or other files from disk when handling requests?</p>
  
  <p>4) Does apache wait for logs to be written to disk before serving the content - if so I will disable logging on the proxy server (or is there way to ensure content is first served without waiting for logs to be written).?</p>
  
  <p>Basically, I want to eliminate disk i/o all together on the 'proxy' server.</p>
  
  <p>Thanks,</p>
  
  <p>JP</p>