+ /**
+ * @param WANObjectCache $cache
+ * @param TitleValue $t
+ * @return string[]
+ * @since 1.28
+ */
+ public function getMutableCacheKeys( WANObjectCache $cache, TitleValue $t ) {
+ if ( $this->isCacheable( $t ) ) {
+ return [ $cache->makeKey( 'page', $t->getNamespace(), sha1( $t->getDBkey() ) ) ];
+ }
+
+ return [];
+ }
+
+ private function isCacheable( LinkTarget $title ) {
+ return ( $title->inNamespace( NS_TEMPLATE ) || $title->inNamespace( NS_FILE ) );
+ }
+
+ private function fetchPageRow( IDatabase $db, LinkTarget $nt ) {
+ $fields = self::getSelectFields();
+ if ( $this->isCacheable( $nt ) ) {
+ $fields[] = 'page_touched';
+ }
+
+ return $db->selectRow(
+ 'page',
+ $fields,
+ [ 'page_namespace' => $nt->getNamespace(), 'page_title' => $nt->getDBkey() ],
+ __METHOD__
+ );
+ }
+
+ /**
+ * Purge the link cache for a title
+ *
+ * @param LinkTarget $title
+ * @since 1.28
+ */
+ public function invalidateTitle( LinkTarget $title ) {
+ if ( $this->isCacheable( $title ) ) {
+ $cache = ObjectCache::getMainWANInstance();
+ $cache->delete(
+ $cache->makeKey( 'page', $title->getNamespace(), sha1( $title->getDBkey() ) )
+ );
+ }
+ }
+