src/Transfer.php
protected function getCachingHeaders($fileinfo)
    {
        // Set default values:
        $last_modified = gmdate('D, d M Y H:i:s', $fileinfo[9]) . ' GMT';
        $etag = md5($last_modified);

        // See if the client has provided the required HTTP headers:
        $if_modified_since = $this->server_value('HTTP_IF_MODIFIED_SINCE', false);
        $if_none_match = $this->server_value('HTTP_IF_NONE_MATCH', false);

        if ($if_modified_since && $if_none_match && $if_none_match == $etag && $if_modified_since == $last_modified) {
            $this->status = 304;
        }

        // Send appropriate response:
        $this->headers['Last-Modified'] = $last_modified;
        $this->headers['ETag'] = $etag;
    }
protected function getCachingHeaders($fileinfo)
    {
        // Set default values:
        $last_modified = gmdate('D, d M Y H:i:s', $fileinfo[9]) . ' GMT';
        $etag = md5($last_modified);

        // See if the client has provided the required HTTP headers:
        $if_modified_since = $this->server_value('HTTP_IF_MODIFIED_SINCE', false);
        $if_none_match = $this->server_value('HTTP_IF_NONE_MATCH', false);

        if ($if_modified_since && $if_none_match && $if_none_match == $etag && $if_modified_since == $last_modified) {
            $this->status = 304;
        }

        // Send appropriate response:
        $this->headers['Last-Modified'] = $last_modified;
        $this->headers['ETag'] = $etag;
    }
protected function getCachingHeaders ( $ fileinfo ) { // Set default values: $ last_modified = gmdate ( 'D, d M Y H:i:s' , $ fileinfo [ 9 ] ) . ' GMT' ; $ etag = md5 ( $ last_modified ) ; // See if the client has provided the required HTTP headers: $ if_modified_since = $ this -> server_value ( 'HTTP_IF_MODIFIED_SINCE' , false ) ; $ if_none_match = $ this -> server_value ( 'HTTP_IF_NONE_MATCH' , false ) ; if ( $ if_modified_since && $ if_none_match && $ if_none_match == $ etag && $ if_modified_since == $ last_modified ) { $ this -> status = 304 ; } // Send appropriate response: $ this -> headers [ 'Last-Modified' ] = $ last_modified ; $ this -> headers [ 'ETag' ] = $ etag ; }
Set file headers that handle "If-Modified-Since" correctly for the
given fileinfo.

@param array $fileinfo Array returned by stat().
Set file headers that handle If - Modified - Since correctly for the given fileinfo .