summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArto Bendiken2007-08-06 14:48:24 (GMT)
committerArto Bendiken2007-08-06 14:48:24 (GMT)
commit704cdc7b33321027fd1bff9d91944f7a714557e1 (patch)
treec6820de98003db51c291eb397d90e143eda7573f
parentae413a356d63e6bf20e2322f05a8bec360cc1fd8 (diff)
Imported 5.x branch from SVN development repository.
- #153179 Patched for Drupal 5.x compatibility, corrected front page handling, and added expiration time to the Boost page footer (kudos to Alexander I. Grafov, Jacob Peddicord and Justin Miller). - #103884 Updated the Boost .htaccess file from Drupal 5.x-dev; also added HTTP headers and special-case mod_rewrite rules for correctly handling caching of the front page (kudos to Axel). - Imported the default .htaccess file from Drupal 5.x-dev. - Updated credits listing in README.txt. - Updated INSTALL.txt instructions to reflect Drupal 5.x.
-rw-r--r--INSTALL.txt20
-rw-r--r--README.txt2
-rw-r--r--boost.module14
-rw-r--r--htaccess/boosted.txt53
-rw-r--r--htaccess/default.txt53
5 files changed, 95 insertions, 47 deletions
diff --git a/INSTALL.txt b/INSTALL.txt
index 02688b4..c292771 100644
--- a/INSTALL.txt
+++ b/INSTALL.txt
@@ -9,7 +9,7 @@ The `path' and `pathauto' modules are recommended.
In order for the static files to be correctly expired, the Drupal cron job
must be correctly setup to execute more often than, or as often as, the
-cache lifetime interval.
+cache lifetime interval you specify.
Since the static page caching is implemented with mod_rewrite directives,
Apache version 1.3 or 2.x with mod_rewrite enabled is required (if Drupal's
@@ -20,25 +20,27 @@ The `drush' module is required for (optional) command line usage.
INSTALLATION
------------
-1. Go to administer >> settings and ensure that Drupal's clean URLs are
- enabled and working properly on your site.
+1. Go to Administer >> Site configuration >> Clean URLs and ensure that
+ Drupal's clean URLs are enabled and working properly on your site.
2. Copy all the module files into a subdirectory called modules/boost/
under your Drupal installation directory.
-3. Go to administer >> modules and enable the Boost module.
+3. Go to Administer >> Site building >> Modules and enable the Boost module.
-4. Go to administer >> settings >> boost to review and change the
- configuration options to your liking.
+4. Go to Administer >> Site configuration >> Performance >> Boost to review
+ and change the module's configuration options to your liking.
-5. Go to administer >> settings and enable static caching.
+5. Go to Administer >> Site configuration >> Performance, specify the cache
+ directory (must be writable by the web server) and enable static caching.
6. Log out from Drupal (or use another browser) and browse around your site
as the anonymous user. Ensure that static files are indeed being
- generated into the Boost cache directory.
+ generated into the Boost cache directory you specified above.
7. IMPORTANT: replace your .htaccess file in the Drupal installation
- directory with the file from modules/boost/htaccess/boosted.txt.
+ directory with the file from modules/boost/htaccess/boosted.txt,
+ customizing the mod_rewrite rules to your particular setup if needed.
(If you fail to do this, static page caching will NOT work!)
8. (See README.txt for information on submitting bug reports.)
diff --git a/README.txt b/README.txt
index dd15005..a26da48 100644
--- a/README.txt
+++ b/README.txt
@@ -5,7 +5,7 @@ you're an experienced user and don't mind figuring things out on your own.
DESCRIPTION
-----------
-This module provides static page caching for Drupal 4.7, enabling a
+This module provides static page caching for Drupal 5.x, enabling a
potentially very significant performance and scalability boost for
heavily-trafficked Drupal sites.
diff --git a/boost.module b/boost.module
index 44d5229..865f73f 100644
--- a/boost.module
+++ b/boost.module
@@ -76,6 +76,14 @@ function boost_menu($may_cache) {
$access = user_access('administer cache');
$items = array();
if ($may_cache) {
+ $items[] = array(
+ 'path' => 'admin/settings/performance/boost',
+ 'title' => t('Boost'),
+ 'description' => t('Enable or disable page caching for anonymous users and set CSS and JS bandwidth optimization options.'),
+ 'callback' => 'drupal_get_form',
+ 'callback arguments' => array('boost_settings'),
+ 'access' => user_access('administer site configuration'),
+ );
// TODO: define menu actions for cache administration.
}
return $items;
@@ -168,9 +176,9 @@ function boost_exit($destination = NULL) {
*/
function boost_form_alter($form_id, &$form) {
// Alter Drupal's settings form by hiding the default cache enabled/disabled control (which will now always default to CACHE_DISABLED), and add our own control instead.
- if ($form_id == 'system_settings_form') {
+ if ($form_id == 'system_performance_settings') {
require_once BOOST_PATH . '/boost.admin.inc';
- $form['cache'] = boost_system_settings_form($form['cache']);
+ $form['page_cache'] = boost_system_settings_form($form['page_cache']);
}
}
@@ -269,7 +277,7 @@ function boost_user($op, &$edit, &$account, $category = NULL) {
*/
function boost_settings() {
require_once BOOST_PATH . '/boost.admin.inc';
- return boost_settings_form();
+ return system_settings_form(boost_settings_form());
}
//////////////////////////////////////////////////////////////////////////////
diff --git a/htaccess/boosted.txt b/htaccess/boosted.txt
index 9b37bff..3358a0b 100644
--- a/htaccess/boosted.txt
+++ b/htaccess/boosted.txt
@@ -3,13 +3,14 @@
#
# Protect files and directories from prying eyes.
-<FilesMatch "(\.(engine|inc|install|module|sh|.*sql|theme|tpl(\.php)?|xtmpl)|code-style\.pl|Entries.*|Repository|Root)$">
- Order deny,allow
- Deny from all
+<FilesMatch "(\.(engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)|code-style\.pl|Entries.*|Repository|Root|Tag|Template)$">
+ Order allow,deny
</FilesMatch>
-# Set some options.
+# Don't show directory listings for URLs which map to a directory.
Options -Indexes
+
+# Follow symbolic links in this directory.
Options +FollowSymLinks
# Customized error messages.
@@ -21,29 +22,43 @@ DirectoryIndex index.php
# Override PHP settings. More in sites/default/settings.php
# but the following cannot be changed at runtime.
-# PHP 4, Apache 1
+# PHP 4, Apache 1.
<IfModule mod_php4.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
+ php_value mbstring.http_input pass
+ php_value mbstring.http_output pass
+ php_value mbstring.encoding_translation 0
</IfModule>
-# PHP 4, Apache 2
+# PHP 4, Apache 2.
<IfModule sapi_apache2.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
+ php_value mbstring.http_input pass
+ php_value mbstring.http_output pass
+ php_value mbstring.encoding_translation 0
</IfModule>
-# PHP 5, Apache 1 and 2
+# PHP 5, Apache 1 and 2.
<IfModule mod_php5.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
+ php_value mbstring.http_input pass
+ php_value mbstring.http_output pass
+ php_value mbstring.encoding_translation 0
</IfModule>
-# Reduce the time dynamically generated pages are cache-able.
+# Requires mod_expires to be enabled.
<IfModule mod_expires.c>
+ # Enable expirations.
+ ExpiresActive On
+ # Cache all files for 2 weeks after access (A).
+ ExpiresDefault A1209600
+ # Do not cache dynamically generated pages.
ExpiresByType text/html A1
</IfModule>
@@ -51,17 +66,21 @@ DirectoryIndex index.php
<IfModule mod_rewrite.c>
RewriteEngine on
- # If your site can be accessed both with and without the prefix www.
- # you can use one of the following settings to force user to use only one option:
+ # If your site can be accessed both with and without the 'www.' prefix, you
+ # can use one of the following settings to redirect users to your preferred
+ # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
#
- # If you want the site to be accessed WITH the www. only, adapt and uncomment the following:
- # RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
- # RewriteRule .* http://www.example.com/ [L,R=301]
+ # To redirect all users to access the site WITH the 'www.' prefix,
+ # (http://example.com/... will be redirected to http://www.example.com/...)
+ # adapt and uncomment the following:
+ # RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
+ # RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
#
- # If you want the site to be accessed only WITHOUT the www. , adapt and uncomment the following:
- # RewriteCond %{HTTP_HOST} !^example\.com$ [NC]
- # RewriteRule .* http://example.com/ [L,R=301]
-
+ # To redirect all users to access the site WITHOUT the 'www.' prefix,
+ # (http://www.example.com/... will be redirected to http://example.com/...)
+ # adapt and uncomment the following:
+ # RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
+ # RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
# Modify the RewriteBase if you are using Drupal in a subdirectory and
# the rewrite rules are not working properly.
diff --git a/htaccess/default.txt b/htaccess/default.txt
index ce35f6d..b43f858 100644
--- a/htaccess/default.txt
+++ b/htaccess/default.txt
@@ -3,13 +3,14 @@
#
# Protect files and directories from prying eyes.
-<FilesMatch "(\.(engine|inc|install|module|sh|.*sql|theme|tpl(\.php)?|xtmpl)|code-style\.pl|Entries.*|Repository|Root)$">
- Order deny,allow
- Deny from all
+<FilesMatch "(\.(engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)|code-style\.pl|Entries.*|Repository|Root|Tag|Template)$">
+ Order allow,deny
</FilesMatch>
-# Set some options.
+# Don't show directory listings for URLs which map to a directory.
Options -Indexes
+
+# Follow symbolic links in this directory.
Options +FollowSymLinks
# Customized error messages.
@@ -21,29 +22,43 @@ DirectoryIndex index.php
# Override PHP settings. More in sites/default/settings.php
# but the following cannot be changed at runtime.
-# PHP 4, Apache 1
+# PHP 4, Apache 1.
<IfModule mod_php4.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
+ php_value mbstring.http_input pass
+ php_value mbstring.http_output pass
+ php_value mbstring.encoding_translation 0
</IfModule>
-# PHP 4, Apache 2
+# PHP 4, Apache 2.
<IfModule sapi_apache2.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
+ php_value mbstring.http_input pass
+ php_value mbstring.http_output pass
+ php_value mbstring.encoding_translation 0
</IfModule>
-# PHP 5, Apache 1 and 2
+# PHP 5, Apache 1 and 2.
<IfModule mod_php5.c>
php_value magic_quotes_gpc 0
php_value register_globals 0
php_value session.auto_start 0
+ php_value mbstring.http_input pass
+ php_value mbstring.http_output pass
+ php_value mbstring.encoding_translation 0
</IfModule>
-# Reduce the time dynamically generated pages are cache-able.
+# Requires mod_expires to be enabled.
<IfModule mod_expires.c>
+ # Enable expirations.
+ ExpiresActive On
+ # Cache all files for 2 weeks after access (A).
+ ExpiresDefault A1209600
+ # Do not cache dynamically generated pages.
ExpiresByType text/html A1
</IfModule>
@@ -51,17 +66,21 @@ DirectoryIndex index.php
<IfModule mod_rewrite.c>
RewriteEngine on
- # If your site can be accessed both with and without the prefix www.
- # you can use one of the following settings to force user to use only one option:
+ # If your site can be accessed both with and without the 'www.' prefix, you
+ # can use one of the following settings to redirect users to your preferred
+ # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
#
- # If you want the site to be accessed WITH the www. only, adapt and uncomment the following:
- # RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
- # RewriteRule .* http://www.example.com/ [L,R=301]
+ # To redirect all users to access the site WITH the 'www.' prefix,
+ # (http://example.com/... will be redirected to http://www.example.com/...)
+ # adapt and uncomment the following:
+ # RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
+ # RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
#
- # If you want the site to be accessed only WITHOUT the www. , adapt and uncomment the following:
- # RewriteCond %{HTTP_HOST} !^example\.com$ [NC]
- # RewriteRule .* http://example.com/ [L,R=301]
-
+ # To redirect all users to access the site WITHOUT the 'www.' prefix,
+ # (http://www.example.com/... will be redirected to http://example.com/...)
+ # adapt and uncomment the following:
+ # RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
+ # RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
# Modify the RewriteBase if you are using Drupal in a subdirectory and
# the rewrite rules are not working properly.