Make WordPress Core

Ticket #28722: trunk.patch

File trunk.patch, 1.3 KB (added by sergej.mueller, 10 years ago)
  • wp-admin/load-styles.php

     
    134134        }
    135135}
    136136
     137$md5_file = md5($out);
     138
     139if ( $md5_file === filter_input(INPUT_SERVER, 'HTTP_IF_NONE_MATCH', FILTER_SANITIZE_STRING) ) {
     140        header('HTTP/1.1 304 Not Modified');
     141        exit();
     142}
     143
     144header('Etag: ' .$md5_file);
    137145header('Content-Type: text/css; charset=UTF-8');
    138146header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT');
    139147header("Cache-Control: public, max-age=$expires_offset");
  • wp-admin/load-scripts.php

     
    143143        $out .= get_file($path) . "\n";
    144144}
    145145
     146$md5_file = md5($out);
     147
     148if ( $md5_file === filter_input(INPUT_SERVER, 'HTTP_IF_NONE_MATCH', FILTER_SANITIZE_STRING) ) {
     149        header('HTTP/1.1 304 Not Modified');
     150        exit();
     151}
     152
     153header('Etag: ' .$md5_file);
    146154header('Content-Type: application/x-javascript; charset=UTF-8');
    147155header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT');
    148156header("Cache-Control: public, max-age=$expires_offset");