Commit 5967b6c1 authored by bgm's avatar bgm

Issue #1416214 gzip support: add a configuration option to enable/disable.

parent 8412e1a5
......@@ -79,6 +79,15 @@ function boost_admin_settings() {
'#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,
);
// Content type extension
$form['cache_types'][$title][$type]['boost_extension_' . $type] = array(
'#type' => 'textfield',
......
......@@ -11,6 +11,11 @@
*/
define('BOOST_CACHEABILITY_PAGES', '');
/**
* Whether the host supports gzip
*/
define('BOOST_GZIP', function_exists('gzencode'));
/**
* Default cookie name.
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment