title: Answering HTTP_IF_MODIFIED_SINCE and HTTP_IF_NONE_MATCH in PHP
body: <p>I have cacheable dynamic content made in PHP 5.1.0+. I already send the correct headers (including Last-Modified and ETag) to clients.</p>
  
  <p>I now want my script to be able to answer <code>$_SERVER['HTTP_IF_MODIFIED_SINCE']</code> and <code>$_SERVER['HTTP_IF_NONE_MATCH']</code> when present. When the conditions matches, I want to answer a <code>HTTP 304 "Not Modified"</code> to clients.</p>
  
  <p>What are the correct conditions? When exactly I issue a 304 instead of the whole content?</p>
  
  <p>The accepted answer in question 
  <a href="https://stackoverflow.com/questions/4506/http-how-to-know-when-to-send-a-304-not-modified-response">How to know when to send a 304 Not Modified response</a> seems to issue this correctly but I have hard times to port that code to PHP 5.</p>
  
  <p>Thank you!</p>