$wgDBtransactions = false; # Set to true if using InnoDB tables
$wgDBmysql4 = false; # Set to true to use enhanced fulltext search
+# Database load balancer
+$wgDBservers = false; # e.g. array("larousse", "pliny")
+$wgDBloads = false; # e.g. array(0.6, 0.4);
+
+
# memcached settings
# See docs/memcached.doc
#
$wgAllowExternalImages = true;
$wgMiserMode = false; # Disable database-intensive features
+$wgDisableQueryPages = false; # Disable all query pages if miser mode is on, not just some
+$wgUseWatchlistCache = false; # Generate a watchlist once every hour or so
+$wgWLCacheTimeout = 3600; # The hour or so mentioned above
# To use inline TeX, you need to compile 'texvc' (in the 'math' subdirectory
# of the MediaWiki package and have latex, dvips, gs (ghostscript), and
function wfSpecialWatchlist()
{
- global $wgUser, $wgOut, $wgLang, $wgTitle;
+ global $wgUser, $wgOut, $wgLang, $wgTitle, $wgMemc;
+ global $wgUseWatchlistCache, $wgWLCacheTimeout, $wgDBname;
global $days, $limit, $target; # From query string
$fname = "wfSpecialWatchlist";
$wgOut->addHTML( "done.\n<p>" );
}
+ if ( $wgUseWatchlistCache ) {
+ $memckey = "$wgDBname:watchlist:id:" . $wgUser->getId();
+ $cache_s = @$wgMemc->get( $memckey );
+ if( $cache_s ){
+ $wgOut->addHTML( wfMsg("wlsaved") );
+ $wgOut->addHTML( $cache_s );
+ return;
+ }
+ }
+
+
$sql = "SELECT COUNT(*) AS n FROM watchlist WHERE wl_user=$uid";
$res = wfQuery( $sql, DB_READ );
$s = wfFetchObject( $res );
wfFreeResult( $res );
$wgOut->addHTML( $s );
+
+ if ( $wgUseWatchlistCache ) {
+ $wgMemc->set( $memckey, $s, $wgWLCacheTimeout);
+ }
}