library/core/class.controller.php
public function SetLastModified($LastModifiedDate) {
      $GMD = gmdate('D, d M Y H:i:s', $LastModifiedDate) . ' GMT';
      $this->SetHeader('Etag', '"'.$GMD.'"');
      $this->SetHeader('Last-Modified', $GMD);
      $IncomingHeaders = getallheaders();
      if (
         isset($IncomingHeaders['If-Modified-Since'])
         && isset ($IncomingHeaders['If-None-Match'])
      ) {
         $IfNoneMatch = $IncomingHeaders['If-None-Match'];
         $IfModifiedSince = $IncomingHeaders['If-Modified-Since'];
         if($GMD == $IfNoneMatch && $IfModifiedSince == $GMD) {
            $Database = Gdn::Database();
            if(!is_null($Database))
               $Database->CloseConnection();

            $this->SetHeader('Content-Length', '0');
            $this->SendHeaders();
            header('HTTP/1.1 304 Not Modified');
            exit("\n\n"); // Send two linefeeds so that the client knows the response is complete
         }
      }
   }
public function SetLastModified($LastModifiedDate) {
      $GMD = gmdate('D, d M Y H:i:s', $LastModifiedDate) . ' GMT';
      $this->SetHeader('Etag', '"'.$GMD.'"');
      $this->SetHeader('Last-Modified', $GMD);
      $IncomingHeaders = getallheaders();
      if (
         isset($IncomingHeaders['If-Modified-Since'])
         && isset ($IncomingHeaders['If-None-Match'])
      ) {
         $IfNoneMatch = $IncomingHeaders['If-None-Match'];
         $IfModifiedSince = $IncomingHeaders['If-Modified-Since'];
         if($GMD == $IfNoneMatch && $IfModifiedSince == $GMD) {
            $Database = Gdn::Database();
            if(!is_null($Database))
               $Database->CloseConnection();

            $this->SetHeader('Content-Length', '0');
            $this->SendHeaders();
            header('HTTP/1.1 304 Not Modified');
            exit("\n\n"); // Send two linefeeds so that the client knows the response is complete
         }
      }
   }
public function SetLastModified ( $ LastModifiedDate ) { $ GMD = gmdate ( 'D, d M Y H:i:s' , $ LastModifiedDate ) . ' GMT' ; $ this -> SetHeader ( 'Etag' , '"' . $ GMD . '"' ) ; $ this -> SetHeader ( 'Last-Modified' , $ GMD ) ; $ IncomingHeaders = getallheaders ( ) ; if ( isset ( $ IncomingHeaders [ 'If-Modified-Since' ] ) && isset ( $ IncomingHeaders [ 'If-None-Match' ] ) ) { $ IfNoneMatch = $ IncomingHeaders [ 'If-None-Match' ] ; $ IfModifiedSince = $ IncomingHeaders [ 'If-Modified-Since' ] ; if ( $ GMD == $ IfNoneMatch && $ IfModifiedSince == $ GMD ) { $ Database = Gdn :: Database ( ) ; if ( ! is_null ( $ Database ) ) $ Database -> CloseConnection ( ) ; $ this -> SetHeader ( 'Content-Length' , '0' ) ; $ this -> SendHeaders ( ) ; header ( 'HTTP/1.1 304 Not Modified' ) ; exit ( "\n\n" ) ; // Send two linefeeds so that the client knows the response is complete } } }
Looks for a Last-Modified header from the browser and compares it to the
supplied date. If the Last-Modified date is after the supplied date, the
controller will send a "304 Not Modified" response code to the web
browser and stop all execution. Otherwise it sets the Last-Modified
header for this page and continues processing.

@param string $LastModifiedDate A unix timestamp representing the date that the current page was last
modified.
Looks for a Last - Modified header from the browser and compares it to the supplied date . If the Last - Modified date is after the supplied date the controller will send a 304 Not Modified response code to the web browser and stop all execution . Otherwise it sets the Last - Modified header for this page and continues processing .