HTMLCacheUpdate Class Reference
[Cache]

Class to invalidate the HTML cache of all the pages linking to a given title. More...

List of all members.

Public Member Functions

 __construct ($titleTo, $table)
 doUpdate ()
 invalidate ($startId=false, $endId=false)
 Invalidate a set of pages, right now.

Public Attributes

 $mTitle
 $mTable
 $mPrefix
 $mRowsPerJob
 $mRowsPerQuery

Protected Member Functions

 insertJobs ()


Detailed Description

Class to invalidate the HTML cache of all the pages linking to a given title.

Small numbers of links will be done immediately, large numbers are pushed onto the job queue.

This class is designed to work efficiently with small numbers of links, and to work reasonably well with up to ~10^5 links. Above ~10^6 links, the memory and time requirements of loading all backlinked IDs in doUpdate() might become prohibitive. The requirements measured at Wikimedia are approximately:

memory: 48 bytes per row time: 16us per row for the query plus processing

The reason this query is done is to support partitioning of the job by backlinked ID. The memory issue could be allieviated by doing this query in batches, but of course LIMIT with an offset is inefficient on the DB side.

The class is nevertheless a vast improvement on the previous method of using Image::getLinksTo() and Title::touchArray(), which uses about 2KB of memory per link.

Definition at line 26 of file HTMLCacheUpdate.php.


Constructor & Destructor Documentation

HTMLCacheUpdate::__construct ( titleTo,
table 
)

Definition at line 31 of file HTMLCacheUpdate.php.

References $wgUpdateRowsPerJob, and $wgUpdateRowsPerQuery.


Member Function Documentation

HTMLCacheUpdate::doUpdate (  ) 

Definition at line 41 of file HTMLCacheUpdate.php.

References $numRows, insertJobs(), invalidate(), and wfRunHooks().

HTMLCacheUpdate::insertJobs (  )  [protected]

Definition at line 55 of file HTMLCacheUpdate.php.

References $batch, and Job::batchInsert().

Referenced by doUpdate().

HTMLCacheUpdate::invalidate ( startId = false,
endId = false 
)

Invalidate a set of pages, right now.

Definition at line 75 of file HTMLCacheUpdate.php.

References $dbw, $endId, $startId, $title, $u, $wgUseFileCache, $wgUseSquid, HTMLFileCache::clearFileCache(), SquidUpdate::newFromTitles(), and wfGetDB().

Referenced by doUpdate().


Member Data Documentation

HTMLCacheUpdate::$mPrefix

Definition at line 28 of file HTMLCacheUpdate.php.

HTMLCacheUpdate::$mRowsPerJob

Definition at line 29 of file HTMLCacheUpdate.php.

HTMLCacheUpdate::$mRowsPerQuery

Definition at line 29 of file HTMLCacheUpdate.php.

HTMLCacheUpdate::$mTable

Definition at line 28 of file HTMLCacheUpdate.php.

HTMLCacheUpdate::$mTitle

Definition at line 28 of file HTMLCacheUpdate.php.


The documentation for this class was generated from the following file:

Generated on Sat Sep 5 02:08:38 2009 for MediaWiki by  doxygen 1.5.9