Skip to content
Commits on Source (16)
// $Id$
REQUIREMENTS
------------
......
// $Id$
DESCRIPTION
-----------
......
// $Id$
This is a listing of known bugs, features that mostly work but are still
somewhat in progress, features that are being considered or planned for
......
// $Id$
This lists some of the users of Boost, describing the setup of the website
in question as well as providing rationale on how Boost benefits the site.
It is hoped that the cases described here may serve as useful guides for new
Boost users evaluating how to best implement static caching on their site.
If you would like to add your website to this list, please contact the
author at http://drupal.org/user/26089/contact, describing your site and
setup. Try to keep the description to a paragraph or two, and don't forget
to include your name and the URL to your website. Note that additions to
this list are posted at the author's sole discretion, and submissions may be
abridged or edited for grammar.
Stand Against Poverty <http://www.standagainstpoverty.org>
United Nations campaign website used to organize events and report event
attendance for events at which nearly 117 million people worldwide
participated. The events seek to raise awareness about poverty and
highlight effort around the United Nations Millennium Development Goals
that seek toward reducing global poverty. The website runs on a cluster
of 4 load-balanced Apache web servers and a single database server.
Boost is used to reduce the overall resource usage consumed by anonymous
visitors on the site in order to devote more infrastructure resources
toward event organizers who sign in as authenticated users to create
events and report event attendance tallies. The Stand Against Poverty
site is is 4 languages, and uses the i18n module. Boost was used with
this patch http://drupal.org/node/174380#comment-663794 to allow for the
use of Boost on i18n sites. While there is still a substantial amount of
traffic on the website during the 3 day campaign, the impact of
anonymous traffic (which includes all traffic, until users sign in) is
greatly reduced.
Hosting infrastructure for StandAgainstPoverty.org provided by the good
folks at http://www.advomatic.com
Development Seed writes more about the campaign on their blog at:
http://www.developmentseed.org/blog/2008/oct/22/united-nations-uses-drupal-huge-anti-poverty-event
http://www.developmentseed.org/blog/2008/oct/23/improving-drupals-performance-boost-module-uns-millennium-campaign
Environmental Working Group <http://www.ewg.org/>
The Environmental Working Group (EWG) uses the power of public
information to protect public health and the environment. Boost is used
to cache all public-facing pages on the site (13,000+ and counting) and
has been critical in sustaining EWG's large amounts of traffic since the
site relaunched using Drupal in early 2007. EWG frequently receives
traffic from multiple press outlets on a given day and Boost allows EWG
to manage its infrastructure in-house and at a fraction of the price
that would otherwise be required.
Arto Bendiken <http://bendiken.net/>
Personal website of the author. Boost is used to cache virtually every
page on the site, quite significantly improving response times despite
the sometimes sluggish shared hosting the site runs on. An additional
......@@ -22,3 +55,10 @@ abridged or edited for grammar.
such as posting comments obviously don't work until MySQL access is
restored, however).
If you would like to add your website to this list, please contact the
author at http://drupal.org/user/26089/contact, describing your site and
setup. Try to keep the description to a paragraph or two, and don't forget
to include your name and the URL to your website. Note that additions to
this list are posted at the author's sole discretion, and submissions may be
abridged or edited for grammar.
<?php
// $Id$
/**
* @file
......@@ -52,10 +51,10 @@ function boost_settings_form($form = array()) {
//_boost_check_htaccess(); // TODO
$options = array(t('Cache every page except the listed pages.'), t('Cache only the listed pages.'));
$description = t("Enter one page per line as Drupal paths. The '*' character is a wildcard. Example paths are '%blog' for the blog page and %blog-wildcard for every personal blog. %front is the front page.", array('%blog' => theme('placeholder', 'blog'), '%blog-wildcard' => theme('placeholder', 'blog/*'), '%front' => theme('placeholder', '<front>')));
$description = t("Enter one page per line as Drupal paths. The '*' character is a wildcard. Example paths are %blog for the blog page and %blog-wildcard for every personal blog. %front is the front page.", array('%blog' => 'blog', '%blog-wildcard' => 'blog/*', '%front' => '<front>'));
if (user_access('use PHP for block visibility')) {
$options[] = t('Cache pages for which the following PHP code returns <code>TRUE</code> (PHP-mode, experts only).');
$description .= t('If the PHP-mode is chosen, enter PHP code between %php. Note that executing incorrect PHP-code can severely break your Drupal site.', array('%php' => theme('placeholder', '<?php ?>')));
$description .= t(' If the PHP-mode is chosen, enter PHP code between %php. Note that executing incorrect PHP-code can severely break your Drupal site.', array('%php' => '<?php ?>'));
}
$form['cacheability'] = array(
'#type' => 'fieldset',
......
<?php
// $Id$
/**
* @file
......
<?php
// $Id$
/**
* @file
......
; $Id$
name = Boost
description = Provides a performance and scalability boost through caching Drupal pages as static HTML files.
package = Caching
<?php
// $Id$
/**
* @file
......
<?php
// $Id$
/**
* @file
......@@ -95,7 +94,7 @@ function boost_menu($may_cache) {
*/
function boost_init() {
// Stop right here unless we're being called for an ordinary page request
if (strpos($_SERVER['PHP_SELF'], 'index.php') === FALSE)
if (strpos($_SERVER['SCRIPT_FILENAME'], 'index.php') === FALSE)
return;
// TODO: check interaction with other modules that use ob_start(); this
......@@ -213,6 +212,12 @@ function boost_comment($comment, $op) {
if (!empty($comment['nid']))
boost_cache_expire('node/' . $comment['nid'], TRUE);
break;
case 'publish':
case 'unpublish':
case 'delete':
if (!empty($comment->nid))
boost_cache_expire('node/' . $comment->nid, TRUE);
break;
}
}
......@@ -300,7 +305,7 @@ function _boost_ob_handler($buffer) {
chdir(dirname($_SERVER['SCRIPT_FILENAME']));
// Check the currently set content type; at present we can't deal with anything else than HTML.
if (_boost_get_content_type() == 'text/html') {
if (_boost_get_content_type() == 'text/html' && _boost_get_http_status() == 200) {
if (strlen($buffer) > 0) { // Sanity check
boost_cache_set($GLOBALS['_boost_path'], $buffer);
}
......@@ -318,14 +323,27 @@ function _boost_ob_handler($buffer) {
* has overridden the content type.
*/
function _boost_get_content_type($default = NULL) {
static $regex = '/^Content-Type:\s*([\w\d\/\-]+)/i';
static $regex = '!^Content-Type:\s*([\w\d\/\-]+)!i';
return _boost_get_http_header($regex, $default);
}
/**
* Determines the HTTP response code that the current page request will be
* returning by examining the HTTP headers that have been output so far.
*/
function _boost_get_http_status($default = 200) {
static $regex = '!^HTTP/1.1\s+(\d+)!';
return (int)_boost_get_http_header($regex, $default);
}
// The last Content-Type header is the one that counts:
function _boost_get_http_header($regex, $default = NULL) {
// The last header is the one that counts:
$headers = preg_grep($regex, explode("\n", drupal_set_header()));
if (!empty($headers) && preg_match($regex, array_pop($headers), $matches))
if (!empty($headers) && preg_match($regex, array_pop($headers), $matches)) {
return $matches[1]; // found it
return $default;
}
return $default; // no such luck
}
//////////////////////////////////////////////////////////////////////////////
......@@ -138,4 +138,3 @@ DirectoryIndex index.php
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>
# $Id$
......@@ -104,4 +104,3 @@ DirectoryIndex index.php
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>
# $Id$
# $Id$
#
# LANGUAGE translation of Drupal (general)
# Copyright YEAR NAME <EMAIL@ADDRESS>
# Generated from files:
# boost.admin.inc,v 1.1.2.1.2.1 2007/08/06 14:48:24 arto
# boost.api.inc,v 1.3.2.1.2.1 2007/08/06 14:48:24 arto
# boost.module,v 1.3.2.2.2.1 2007/08/06 14:48:24 arto
# boost.info,v 1.1.2.1.2.1 2007/08/06 14:48:24 arto
# boost.install,v 1.2.2.1.2.1 2007/08/06 14:48:24 arto
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"POT-Creation-Date: 2007-12-03 20:55+0100\n"
"PO-Revision-Date: YYYY-mm-DD HH:MM+ZZZZ\n"
"Last-Translator: NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <EMAIL@ADDRESS>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
#: boost.admin.inc:21
msgid "Static page cache"
msgstr ""
#: boost.admin.inc:23
msgid "Disabled"
msgstr ""
#: boost.admin.inc:24
msgid "Enabled"
msgstr ""
#: boost.admin.inc:25
msgid "Static page caching is a mechanism which stores dynamically generated web pages as HTML files in a special cache directory located under the Drupal installation directory. By caching a web page in this manner, the web server can serve it out in the fastest possible manner, without invoking PHP or Drupal at all. While this does provide a significant performance and scalability boost, you should note that it could have negative usability side-effects unless your site is targeted at an audience consisting mostly of \"anonymous\" visitors."
msgstr ""
#: boost.admin.inc:28
msgid "On high-traffic sites it can become necessary to enforce a minimum cache lifetime. The minimum cache lifetime is the minimum amount of time that will go by before the cache is emptied and recreated. A larger minimum cache lifetime offers better performance, but users will not see new content for a longer period of time."
msgstr ""
#: boost.admin.inc:33
msgid "Cache file path"
msgstr ""
#: boost.admin.inc:38
msgid "A file system path where the cache files will be stored. This directory has to exist and be writable by Drupal. The default setting is to store the files in a directory named 'cache' under the Drupal installation directory. If you change this, you must also change the URL rewrite rules in your web server configuration (.htaccess for Apache, lighttpd.conf for Lighttpd), or caching will not work."
msgstr ""
#: boost.admin.inc:54
msgid "Cache every page except the listed pages."
msgstr ""
#: boost.admin.inc:54
msgid "Cache only the listed pages."
msgstr ""
#: boost.admin.inc:55
msgid "Enter one page per line as Drupal paths. The '*' character is a wildcard. Example paths are '%blog' for the blog page and %blog-wildcard for every personal blog. %front is the front page."
msgstr ""
#: boost.admin.inc:57
msgid "Cache pages for which the following PHP code returns <code>TRUE</code> (PHP-mode, experts only)."
msgstr ""
#: boost.admin.inc:58
msgid "If the PHP-mode is chosen, enter PHP code between %php. Note that executing incorrect PHP-code can severely break your Drupal site."
msgstr ""
#: boost.admin.inc:62
msgid "Cacheability settings"
msgstr ""
#: boost.admin.inc:67
msgid "Cache specific pages"
msgstr ""
#: boost.admin.inc:73
msgid "Pages"
msgstr ""
#: boost.admin.inc:94
msgid "Advanced settings"
msgstr ""
#: boost.admin.inc:100
msgid "Cache file extension"
msgstr ""
#: boost.admin.inc:105
msgid "The file extension to append to the file name of the generated cache files. Note that this setting is of no relevance to any public URLs, and it is strongly recommended to leave this as the default '.html' unless you know what you are doing. If you change this, you must also change the URL rewrite rules in your web server configuration (.htaccess for Apache, lighttpd.conf for Lighttpd), or caching will not work."
msgstr ""
#: boost.admin.inc:109
msgid "Page fetch method"
msgstr ""
#: boost.admin.inc:111
msgid "PHP fopen() wrapper"
msgstr ""
#: boost.admin.inc:111
msgid "Wget shell command"
msgstr ""
#: boost.admin.inc:111
msgid "curl shell command"
msgstr ""
#: boost.admin.inc:112
msgid "The method used to retrieve the contents of the Drupal pages to be cached. The default should work in most cases."
msgstr ""
#: boost.admin.inc:116
msgid "Pre-process function"
msgstr ""
#: boost.admin.inc:119
msgid "The name of a PHP function used to pre-process the contents of each page before writing them out to static files. The function is called with the contents of the page passed as a string argument, and its return value is used as the data written out to the disk."
msgstr ""
#: boost.api.inc:138
msgid "Unable to write file: %file"
msgstr ""
#: boost.api.inc:150
msgid "Unable to create symlink: %link to %target"
msgstr ""
#: boost.api.inc:138;150 boost.module:52;192;0
msgid "boost"
msgstr ""
#: boost.module:54 boost.info:0
msgid "Provides a performance and scalability boost through caching Drupal pages as static HTML files."
msgstr ""
#: boost.module:81 boost.info:0
msgid "Boost"
msgstr ""
#: boost.module:82
msgid "Enable or disable page caching for anonymous users and set CSS and JS bandwidth optimization options."
msgstr ""
#: boost.module:192
msgid "Expired stale files from static page cache."
msgstr ""
#: boost.module:69
msgid "administer cache"
msgstr ""
#: boost.install:21
msgid "Drupal standard page caching disabled by Boost."
msgstr ""
#: boost.install:24
msgid "Boost module successfully installed."
msgstr ""
#: boost.info:0
msgid "Caching"
msgstr ""
# Danish translation of Drupal (boost.module)
# Copyright 2007 Morten Wulff <wulff@ratatosk.net>
msgid ""
msgstr ""
"Project-Id-Version: Danish translation of Drupal (boost.module) $Id$\n"
"POT-Creation-Date: 2007-12-03 20:55+0100\n"
"PO-Revision-Date: 2007-12-03 21:05+0100\n"
"Last-Translator: Morten Wulff <wulff@ratatosk.net>\n"
"Language-Team: Danish <l10n@drupaldanmark.dk>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-Language: Danish\n"
"X-Poedit-Country: DENMARK\n"
#: boost.admin.inc:21
msgid "Static page cache"
msgstr "Statisk mellemlager"
#: boost.admin.inc:23
msgid "Disabled"
msgstr "Deaktiveret"
#: boost.admin.inc:24
msgid "Enabled"
msgstr "Aktiveret"
#: boost.admin.inc:25
msgid "Static page caching is a mechanism which stores dynamically generated web pages as HTML files in a special cache directory located under the Drupal installation directory. By caching a web page in this manner, the web server can serve it out in the fastest possible manner, without invoking PHP or Drupal at all. While this does provide a significant performance and scalability boost, you should note that it could have negative usability side-effects unless your site is targeted at an audience consisting mostly of \"anonymous\" visitors."
msgstr ""
#: boost.admin.inc:28
msgid "On high-traffic sites it can become necessary to enforce a minimum cache lifetime. The minimum cache lifetime is the minimum amount of time that will go by before the cache is emptied and recreated. A larger minimum cache lifetime offers better performance, but users will not see new content for a longer period of time."
msgstr ""
#: boost.admin.inc:33
msgid "Cache file path"
msgstr "Mellemlager sti"
#: boost.admin.inc:38
msgid "A file system path where the cache files will be stored. This directory has to exist and be writable by Drupal. The default setting is to store the files in a directory named 'cache' under the Drupal installation directory. If you change this, you must also change the URL rewrite rules in your web server configuration (.htaccess for Apache, lighttpd.conf for Lighttpd), or caching will not work."
msgstr ""
#: boost.admin.inc:54
msgid "Cache every page except the listed pages."
msgstr "Gem alle sider undtagen de nævnte i mellemlageret."
#: boost.admin.inc:54
msgid "Cache only the listed pages."
msgstr "Gem kun de nævnte sider i mellemlageret."
#: boost.admin.inc:55
msgid "Enter one page per line as Drupal paths. The '*' character is a wildcard. Example paths are '%blog' for the blog page and %blog-wildcard for every personal blog. %front is the front page."
msgstr "Indtast én side pr. linje som Drupal-stier. Brug '*'-tegnet som joker. Indtast f.eks. '%blog' for blogsiden og %blog-wildcard for alle personlige blogs. %front er forsiden."
#: boost.admin.inc:57
msgid "Cache pages for which the following PHP code returns <code>TRUE</code> (PHP-mode, experts only)."
msgstr ""
#: boost.admin.inc:58
msgid "If the PHP-mode is chosen, enter PHP code between %php. Note that executing incorrect PHP-code can severely break your Drupal site."
msgstr ""
#: boost.admin.inc:62
msgid "Cacheability settings"
msgstr "Indtillinger for mellemlagring"
#: boost.admin.inc:67
msgid "Cache specific pages"
msgstr "Gem specifikke sider i mellemlager"
#: boost.admin.inc:73
msgid "Pages"
msgstr "Sider"
#: boost.admin.inc:94
msgid "Advanced settings"
msgstr "Avancerede indstillinger"
#: boost.admin.inc:100
msgid "Cache file extension"
msgstr "Mellemlager fil-endelse"
#: boost.admin.inc:105
msgid "The file extension to append to the file name of the generated cache files. Note that this setting is of no relevance to any public URLs, and it is strongly recommended to leave this as the default '.html' unless you know what you are doing. If you change this, you must also change the URL rewrite rules in your web server configuration (.htaccess for Apache, lighttpd.conf for Lighttpd), or caching will not work."
msgstr ""
#: boost.admin.inc:109
msgid "Page fetch method"
msgstr "Hent sider med"
#: boost.admin.inc:111
msgid "PHP fopen() wrapper"
msgstr "PHP fopen()-omslag"
#: boost.admin.inc:111
msgid "Wget shell command"
msgstr "wget shell-kommando"
#: boost.admin.inc:111
msgid "curl shell command"
msgstr "curl shell-kommando"
#: boost.admin.inc:112
msgid "The method used to retrieve the contents of the Drupal pages to be cached. The default should work in most cases."
msgstr ""
#: boost.admin.inc:116
msgid "Pre-process function"
msgstr "Funktion til forbehandling"
#: boost.admin.inc:119
msgid "The name of a PHP function used to pre-process the contents of each page before writing them out to static files. The function is called with the contents of the page passed as a string argument, and its return value is used as the data written out to the disk."
msgstr "Navnet på en PHP-funktion der forbehandler hver side før den skrives til en statisk fil. Funktionen kaldes med sidens indhold som argument, og dens returværdi skrives til disken."
#: boost.api.inc:138
msgid "Unable to write file: %file"
msgstr "Kan ikke skrive til filen: %file"
#: boost.api.inc:150
msgid "Unable to create symlink: %link to %target"
msgstr "Kan ikke oprette symbolsk henvisning: %link til %target"
#: boost.api.inc:138;150
#: boost.module:52;192;0
msgid "boost"
msgstr "boost"
#: boost.module:54
#: boost.info:0
msgid "Provides a performance and scalability boost through caching Drupal pages as static HTML files."
msgstr "Forbedrer ydelsen eller skalabiliteten ved at mellemlagre Drupal-sider som statiske HTML-filer."
#: boost.module:81
#: boost.info:0
msgid "Boost"
msgstr "Boost"
#: boost.module:82
msgid "Enable or disable page caching for anonymous users and set CSS and JS bandwidth optimization options."
msgstr "Aktiver eller deaktiver mellemlager for anonyme brugere og vælg indstillinger for optimering af CSS og JS båndbreddeforbrug."
#: boost.module:192
msgid "Expired stale files from static page cache."
msgstr "Udløbne sider slettet fra mellemlageret."
#: boost.module:69
msgid "administer cache"
msgstr "administrer mellemlager"
#: boost.install:21
msgid "Drupal standard page caching disabled by Boost."
msgstr "Drupal mellemlager deaktiveret af Boost."
#: boost.install:24
msgid "Boost module successfully installed."
msgstr "Boost-modulet er nu installeret."
#: boost.info:0
msgid "Caching"
msgstr "Mellemlagring"