diff --git src/wp-admin/load-scripts.php src/wp-admin/load-scripts.php
index 4c7d40e..011ae3c 100644
|
|
$out = ''; |
33 | 33 | $wp_scripts = new WP_Scripts(); |
34 | 34 | wp_default_scripts($wp_scripts); |
35 | 35 | |
| 36 | if ( isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) && stripslashes( $_SERVER['HTTP_IF_NONE_MATCH'] ) === $wp_version ) { |
| 37 | $protocol = $_SERVER['SERVER_PROTOCOL']; |
| 38 | if ( ! in_array( $protocol, array( 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0' ) ) ) { |
| 39 | $protocol = 'HTTP/1.0'; |
| 40 | } |
| 41 | header( "$protocol 304 Not Modified" ); |
| 42 | exit(); |
| 43 | } |
| 44 | |
36 | 45 | foreach ( $load as $handle ) { |
37 | 46 | if ( !array_key_exists($handle, $wp_scripts->registered) ) |
38 | 47 | continue; |
… |
… |
foreach ( $load as $handle ) { |
41 | 50 | $out .= get_file($path) . "\n"; |
42 | 51 | } |
43 | 52 | |
| 53 | header("Etag: $wp_version"); |
44 | 54 | header('Content-Type: application/javascript; charset=UTF-8'); |
45 | 55 | header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT'); |
46 | 56 | header("Cache-Control: public, max-age=$expires_offset"); |
diff --git src/wp-admin/load-styles.php src/wp-admin/load-styles.php
index 2563e6f..7d7d404 100644
|
|
$out = ''; |
30 | 30 | $wp_styles = new WP_Styles(); |
31 | 31 | wp_default_styles($wp_styles); |
32 | 32 | |
| 33 | if ( isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) && stripslashes( $_SERVER['HTTP_IF_NONE_MATCH'] ) === $wp_version ) { |
| 34 | $protocol = $_SERVER['SERVER_PROTOCOL']; |
| 35 | if ( ! in_array( $protocol, array( 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0' ) ) ) { |
| 36 | $protocol = 'HTTP/1.0'; |
| 37 | } |
| 38 | header( "$protocol 304 Not Modified" ); |
| 39 | exit(); |
| 40 | } |
| 41 | |
33 | 42 | foreach ( $load as $handle ) { |
34 | 43 | if ( !array_key_exists($handle, $wp_styles->registered) ) |
35 | 44 | continue; |
… |
… |
foreach ( $load as $handle ) { |
54 | 63 | } |
55 | 64 | } |
56 | 65 | |
| 66 | header("Etag: $wp_version"); |
57 | 67 | header('Content-Type: text/css; charset=UTF-8'); |
58 | 68 | header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT'); |
59 | 69 | header("Cache-Control: public, max-age=$expires_offset"); |