index.php
changeset 547 0a2c1ce32d91
parent 542 5841df0ab575
child 564 a1c450a911a6
equal deleted inserted replaced
546:506e8e3e2af2 547:0a2c1ce32d91
   565     
   565     
   566     // Re-enable output buffering to allow the Gzip function (below) to work
   566     // Re-enable output buffering to allow the Gzip function (below) to work
   567     ob_start();
   567     ob_start();
   568     
   568     
   569     // Generate an ETag
   569     // Generate an ETag
   570     // format: first 10 digits of SHA1 of page name, user id in hex, page timestamp in hex
   570     // format: first 10 digits of SHA1 of page name, user id in hex, user and auth levels, page timestamp in hex
   571     $etag = substr(sha1($paths->namespace . ':' . $paths->page_id), 0, 10) . '-' .
   571     $etag = substr(sha1($paths->namespace . ':' . $paths->page_id), 0, 10) . '-' .
   572             dechex($session->user_id) . '-' .
   572             "u{$session->user_id}l{$session->user_level}a{$session->auth_level}-" .
   573             dechex($page_timestamp);
   573             dechex($page_timestamp);
   574             
   574             
   575     if ( isset($_SERVER['HTTP_IF_NONE_MATCH']) )
   575     if ( isset($_SERVER['HTTP_IF_NONE_MATCH']) )
   576     {
   576     {
   577       if ( "\"$etag\"" == $_SERVER['HTTP_IF_NONE_MATCH'] )
   577       if ( "\"$etag\"" == $_SERVER['HTTP_IF_NONE_MATCH'] )