summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip_Clarke2014-05-02 18:55:30 (GMT)
committerPhilip_Clarke2014-05-02 18:55:30 (GMT)
commit29f8423bce50e6634758ed114c41e518f00c96ca (patch)
tree09ab83961f512cbfff857aadca4861b59e637fd2
parenteacffe262fe3fda5f75c6c662b3aaa488b4129a6 (diff)
Code clean up for #1416214
-rw-r--r--boost.admin.htaccess.inc24
-rw-r--r--boost.admin.inc18
-rw-r--r--boost.module2
3 files changed, 24 insertions, 20 deletions
diff --git a/boost.admin.htaccess.inc b/boost.admin.htaccess.inc
index 3bebe36..0058e17 100644
--- a/boost.admin.htaccess.inc
+++ b/boost.admin.htaccess.inc
@@ -203,16 +203,18 @@ function boost_admin_htaccess_generate_htaccess() {
$normal_count = 0;
foreach ($enabled_file_extensions as $extension => $values) {
$type = $values['content_type'];
- if ($values['gzip']) {
- $output['gzip'] .= " RewriteCond $document_root$base_path$cache_dir/%{ENV:boostpath}/$server_name%{REQUEST_URI}$char%{QUERY_STRING}\.$extension\.gz -s\n";
- $output['gzip'] .= " RewriteRule .* $cache_dir/%{ENV:boostpath}/$server_name%{REQUEST_URI}$char%{QUERY_STRING}\.$extension\.gz [L,T=$type,E=no-gzip:1]\n";
- $gzip_count++;
- }
+// #1416214 - https://drupal.org/node/1416214#comment-7225650
+// if ($values['gzip']) {
+// $output['gzip'] .= " RewriteCond $document_root$base_path$cache_dir/%{ENV:boostpath}/$server_name%{REQUEST_URI}$char%{QUERY_STRING}\.$extension\.gz -s\n";
+// $output['gzip'] .= " RewriteRule .* $cache_dir/%{ENV:boostpath}/$server_name%{REQUEST_URI}$char%{QUERY_STRING}\.$extension\.gz [L,T=$type,E=no-gzip:1]\n";
+// $gzip_count++;
+// }
$output['normal'] .= " RewriteCond $document_root$base_path$cache_dir/%{ENV:boostpath}/$server_name%{REQUEST_URI}$char%{QUERY_STRING}\.$extension -s\n";
$output['normal'] .= " RewriteRule .* $cache_dir/%{ENV:boostpath}/$server_name%{REQUEST_URI}$char%{QUERY_STRING}\.$extension [L,T=$type]\n";
$normal_count++;
}
$skip = !empty($gzip_count) ? $normal_count + $gzip_count + 1 : $normal_count;
+
// Generate the rules
$string = " ### BOOST START ###\n";
@@ -233,11 +235,13 @@ function boost_admin_htaccess_generate_htaccess() {
$string .= " RewriteCond %{ENV:REDIRECT_STATUS} 200\n";
$string .= " RewriteRule .* - [S=$skip]\n";
$string .= "\n";
- $string .= " # GZIP\n";
- $string .= " RewriteCond %{HTTP:Accept-encoding} !gzip\n";
- $string .= " RewriteRule .* - [S=$gzip_count]\n";
- $string .= $output['gzip'];
- $string .= "\n";
+// Serving of .gz files disabled
+// #1416214 - https://drupal.org/node/1416214#comment-7225650
+// $string .= " # GZIP\n";
+// $string .= " RewriteCond %{HTTP:Accept-encoding} !gzip\n";
+// $string .= " RewriteRule .* - [S=$gzip_count]\n";
+// $string .= $output['gzip'];
+// $string .= "\n";
$string .= " # NORMAL\n";
$string .= $output['normal'];
}
diff --git a/boost.admin.inc b/boost.admin.inc
index 9001208..d14dc43 100644
--- a/boost.admin.inc
+++ b/boost.admin.inc
@@ -78,15 +78,15 @@ function boost_admin_settings() {
'#title' => t('Cache Enabled'),
'#default_value' => $values['enabled'],
);
-
- // Enable gzip?
- $form['cache_types'][$title][$type]['boost_gzip_' . $type] = array(
- '#type' => 'checkbox',
- '#title' => t('Enable gzip compression'),
- '#description' => (BOOST_GZIP ? t('Avoids having to compress the content by the web server on every request (recommended).') : t('Your host does not support zlib. See: !url', array('!url' => 'http://www.php.net/manual/en/zlib.installation.php'))),
- '#default_value' => (BOOST_GZIP ? $values['gzip'] : 0),
- '#disabled' => ! BOOST_GZIP,
- );
+// https://drupal.org/node/1416214#comment-7225650
+// // Enable gzip?
+// $form['cache_types'][$title][$type]['boost_gzip_' . $type] = array(
+// '#type' => 'checkbox',
+// '#title' => t('Enable gzip compression'),
+// '#description' => (BOOST_GZIP ? t('Avoids having to compress the content by the web server on every request (recommended).') : t('Your host does not support zlib. See: !url', array('!url' => 'http://www.php.net/manual/en/zlib.installation.php'))),
+// '#default_value' => (BOOST_GZIP ? $values['gzip'] : 0),
+// '#disabled' => ! BOOST_GZIP,
+// );
// Content type extension
$form['cache_types'][$title][$type]['boost_extension_' . $type] = array(
diff --git a/boost.module b/boost.module
index a05e594..a6b3db2 100644
--- a/boost.module
+++ b/boost.module
@@ -326,7 +326,7 @@ function boost_exit($destination = NULL) {
// Gzip support.
if (BOOST_GZIP && $_boost['matched_header_info']['gzip']) {
- // #1416214
+ // #1416214 https://drupal.org/node/1416214#comment-7225650
// boost_write_file($_boost['filename'] . '.gz', gzencode($data, 9));
}
}