summaryrefslogtreecommitdiff
path: root/database
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2005-04-11 19:05:52 +0000
committerDries Buytaert <dries@buytaert.net>2005-04-11 19:05:52 +0000
commite3d62d907b07dbace7404fb378a97e8d38cf1e9e (patch)
tree590c126f6dbb469ebae8022769f926115dc6602c /database
parentd0d5b52ac1f1248b43da892621ce2c46af4fedcc (diff)
downloadbrdo-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 'database')
-rw-r--r--database/database.mysql1
-rw-r--r--database/database.pgsql1
-rw-r--r--database/updates.inc14
3 files changed, 15 insertions, 1 deletions
diff --git a/database/database.mysql b/database/database.mysql
index b50d80cab..fbb2e76b5 100644
--- a/database/database.mysql
+++ b/database/database.mysql
@@ -574,6 +574,7 @@ CREATE TABLE sessions (
sid varchar(32) NOT NULL default '',
hostname varchar(128) NOT NULL default '',
timestamp int(11) NOT NULL default '0',
+ cache int(11) NOT NULL default '0',
session longtext,
KEY uid (uid),
PRIMARY KEY (sid),
diff --git a/database/database.pgsql b/database/database.pgsql
index 64a63215d..a911049f0 100644
--- a/database/database.pgsql
+++ b/database/database.pgsql
@@ -587,6 +587,7 @@ CREATE TABLE sessions (
sid varchar(32) NOT NULL default '',
hostname varchar(128) NOT NULL default '',
timestamp integer NOT NULL default '0',
+ cache integer NOT NULL default '0',
session text,
PRIMARY KEY (sid)
);
diff --git a/database/updates.inc b/database/updates.inc
index 076d647ad..19eac2c26 100644
--- a/database/updates.inc
+++ b/database/updates.inc
@@ -105,7 +105,8 @@ $sql_updates = array(
"2005-03-03" => "update_126",
"2005-03-18" => "update_127",
"2005-03-21" => "update_128",
- "2005-04-08: first update since Drupal 4.6.0 release" => "update_129"
+ "2005-04-08: first update since Drupal 4.6.0 release" => "update_129",
+ "2005-04-10" => "update_130"
);
function update_32() {
@@ -2364,4 +2365,15 @@ function update_129() {
return $ret;
}
+function update_130() {
+ $ret = array();
+ if ($GLOBALS['db_type'] == 'mysql') {
+ $ret[] = update_sql("ALTER TABLE sessions ADD cache int(11) NOT NULL default '0' AFTER timestamp");
+ }
+ elseif ($GLOBALS['db_type'] == 'pgsql') {
+ $ret[] = update_sql("ALTER TABLE sessions ADD cache int(11) NOT NULL default '0' AFTER timestamp");
+ }
+ return $ret;
+}
+
?>