r70951 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70950‎ | r70951 | r70952 >
Date:13:30, 12 August 2010
Author:peter17
Status:ok (Comments)
Tags:
Comment:
Invalidate the cache of distant pages when local templates are created/deleted/undeleted
Modified paths:
  • /branches/iwtransclusion/phase3/includes/Article.php (modified) (history)

Diff [purge]

Index: branches/iwtransclusion/phase3/includes/Article.php
@@ -4089,6 +4089,8 @@
40904090 * @param $title a title object
40914091 */
40924092 public static function onArticleCreate( $title ) {
 4093+ global $wgDeferredUpdateList;
 4094+
40934095 # Update existence markers on article/talk tabs...
40944096 if ( $title->isTalkPage() ) {
40954097 $other = $title->getSubjectPage();
@@ -4102,13 +4104,16 @@
41034105 $title->touchLinks();
41044106 $title->purgeSquid();
41054107 $title->deleteTitleProtection();
 4108+
 4109+ # Invalidate caches of distant articles which transclude this page
 4110+ $wgDeferredUpdateList[] = new HTMLCacheUpdate( $title, 'globaltemplatelinks' );
41064111 }
41074112
41084113 /**
41094114 * Clears caches when article is deleted
41104115 */
41114116 public static function onArticleDelete( $title ) {
4112 - global $wgMessageCache;
 4117+ global $wgMessageCache, $wgDeferredUpdateList;
41134118
41144119 # Update existence markers on article/talk tabs...
41154120 if ( $title->isTalkPage() ) {
@@ -4145,6 +4150,9 @@
41464151
41474152 # Image redirects
41484153 RepoGroup::singleton()->getLocalRepo()->invalidateImageRedirect( $title );
 4154+
 4155+ # Invalidate caches of distant articles which transclude this page
 4156+ $wgDeferredUpdateList[] = new HTMLCacheUpdate( $title, 'globaltemplatelinks' );
41494157 }
41504158
41514159 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r87110Merge r70803, r70951reedy00:48, 29 April 2011
r92995Merge r87110, Merge of r70803, r70951reedy18:22, 24 July 2011

Comments

#Comment by Catrope (talk | contribs)   18:21, 12 August 2010
+		$wgDeferredUpdateList[] = new HTMLCacheUpdate( $title, 'globaltemplatelinks' );

HTMLCacheUpdate doesn't support interwiki titles and BacklinkCache doesn't support the globaltemplatelinks table, so this isn't gonna work. In general, purging a distant wiki's HTML cache is very hard because you'd have to know in which directory the distant wiki keeps its HTML cache files.

#Comment by Peter17 (talk | contribs)   22:28, 12 August 2010

Well... this is just the same code as for the cache invalidation on page edition. This will just update page_touched and is working quite well... I think doing so on page creation/deletion/undeletion is better than nothing. For the Squid and HTML files cache, yes, there is no code at all, so, they are not invalidated, but I cannot change the name of the class... :-|

#Comment by Catrope (talk | contribs)   07:39, 13 August 2010

Right, the name is misleading and it does support the gtl table. My bad.

Status & tagging log