diff options
author | Dries Buytaert <dries@buytaert.net> | 2005-04-11 19:05:52 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2005-04-11 19:05:52 +0000 |
commit | e3d62d907b07dbace7404fb378a97e8d38cf1e9e (patch) | |
tree | 590c126f6dbb469ebae8022769f926115dc6602c /modules/system/system.module | |
parent | d0d5b52ac1f1248b43da892621ce2c46af4fedcc (diff) | |
download | brdo-e3d62d907b07dbace7404fb378a97e8d38cf1e9e.tar.gz brdo-e3d62d907b07dbace7404fb378a97e8d38cf1e9e.tar.bz2 |
- Patch #19298 by Jeremy: loose caching!
Drupal's existing caching mechanism doesn't perform well on highly dynamic websites in which the cache is flushed frequently. One example is a site that is under attack by a spambot that is posting spam comments every few seconds, causing all cached pages to be flushed every few seconds. Loose caching immediately flushes the cache only for specific users who have modified cached data (whether or not they are logged in), delaying the flushing of data for other users by several minutes.
(I rewrote the help text a bit and made minor changes to the code comments.)
Diffstat (limited to 'modules/system/system.module')
-rw-r--r-- | modules/system/system.module | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/modules/system/system.module b/modules/system/system.module index 5d75bba29..a5d4133a4 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -35,9 +35,7 @@ function system_help($section) { <p>If your hosting company does not allow you to set up crontab entries, you can always ask someone else to set up an entry for you. After all, virtually any Unix/Linux machine with access to the internet can set up a crontab entry to frequently visit %cron-link.</p> <p>For the Unix/Linux crontab itself, use a browser like <a href=\"%lynx\">lynx</a> or <a href=\"%wget\">wget</a> but make sure the process terminates: either use <code>/usr/bin/lynx -source %base_url/cron.php</code> or <code>/usr/bin/wget -o /dev/null -O /dev/null %cron-link</code>. Take a look at the example scripts in the <code>scripts</code>-directory. Make sure to adjust them to fit your needs. A good crontab line to run the cron script once every hour would be: <pre> 00 * * * * /home/www/drupal/scripts/cron-lynx.sh</pre> - Note that it is essential to access <code>cron.php</code> using a browser on the web site's domain; do not run it using command line PHP and avoid using <code>localhost</code> or <code>127.0.0.1</code> or some of the environment variables will not be set correctly and features may not work as expected.</p> - <h3><a id=\"cache\">Cache</a></h3> - <p>Drupal has a caching mechanism which stores dynamically generated web pages in a database. By caching a web page, Drupal does not have to create the page each time someone wants to view it, instead it takes only one SQL query to display it, reducing response time and the server's load. Only pages requested by \"anonymous\" users are cached. In order to reduce server load and save bandwidth, Drupal stores and sends cached pages compressed.</p>", array('%base_url' => $base_url, '%cron-link' => "<a href=\"$base_url/cron.php\">$base_url/cron.php</a>", '%lynx' => 'http://lynx.browser.org', '%wget' => 'http://www.gnu.org/software/wget/wget.html' )); + Note that it is essential to access <code>cron.php</code> using a browser on the web site's domain; do not run it using command line PHP and avoid using <code>localhost</code> or <code>127.0.0.1</code> or some of the environment variables will not be set correctly and features may not work as expected.</p>", array('%base_url' => $base_url, '%cron-link' => "<a href=\"$base_url/cron.php\">$base_url/cron.php</a>", '%lynx' => 'http://lynx.browser.org', '%wget' => 'http://www.gnu.org/software/wget/wget.html' )); case 'admin/modules#description': return t('Handles general site configuration for administrators.'); } @@ -225,7 +223,7 @@ function system_view_general() { $output .= form_group(t('Error handling'), $group); // Caching: - $group = form_radios(t('Cache support'), 'cache', variable_get('cache', 0), array(t('Disabled'), t('Enabled')), t('Enable or disable the caching of rendered pages. When caching is enabled, Drupal will flush the cache when required to make sure updates take effect immediately. Check the <a href="%documentation">cache documentation</a> for information on Drupal\'s cache system.', array('%documentation' => url('admin/help', NULL, NULL, 'cache')))); + $group = form_radios(t('Page cache'), 'cache', variable_get('cache', CACHE_DISABLED), array(CACHE_DISABLED => t('Disabled (low-traffic sites)'), CACHE_ENABLED_STRICT => t('Strict (medium-traffic sites)'), CACHE_ENABLED_LOOSE => t('Loose (high-traffic sites)')), t("Drupal has a caching mechanism which stores dynamically generated web pages in a database. By caching a web page, Drupal does not have to create the page each time someone wants to view it, instead it takes only one SQL query to display it, reducing response time and the server's load. Only pages requested by \"anonymous\" users are cached. In order to reduce server load and save bandwidth, Drupal stores and sends cached pages compressed. Drupal supports strict caching and loose caching. Strict caching immediately deletes cached data as soon as it becomes invalid for any user. Loose caching delays the deletion of cached data to provide better performance for high traffic sites.")); $output .= form_group(t('Cache settings'), $group); |