Compression tweaks.
git-svn-id: https://develop.svn.wordpress.org/trunk@3320 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
dcd75531cb
commit
b7ef286e0b
|
@ -767,7 +767,6 @@ function get_all_page_ids() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function gzip_compression() {
|
function gzip_compression() {
|
||||||
if ( strstr($_SERVER['PHP_SELF'], 'wp-admin') ) return false;
|
|
||||||
if ( !get_settings('gzipcompression') ) return false;
|
if ( !get_settings('gzipcompression') ) return false;
|
||||||
|
|
||||||
if ( extension_loaded('zlib') ) {
|
if ( extension_loaded('zlib') ) {
|
||||||
|
|
|
@ -56,10 +56,7 @@
|
||||||
// General options
|
// General options
|
||||||
$expiresOffset = 3600 * 24 * 30; // 30 days util client cache expires
|
$expiresOffset = 3600 * 24 * 30; // 30 days util client cache expires
|
||||||
|
|
||||||
// Only gzip the contents if clients and server support it
|
gzip_compression();
|
||||||
$encodings = explode(',', strtolower($_SERVER['HTTP_ACCEPT_ENCODING']));
|
|
||||||
if (in_array('gzip', $encodings) && function_exists('ob_gzhandler'))
|
|
||||||
@ ob_start("ob_gzhandler"); // Don't let warnings foul up the JS
|
|
||||||
|
|
||||||
// Output rest of headers
|
// Output rest of headers
|
||||||
header("Content-type: text/javascript; charset: UTF-8");
|
header("Content-type: text/javascript; charset: UTF-8");
|
||||||
|
|
Loading…
Reference in New Issue