X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiFeedRecentChanges.php;h=a2641ee646c95c5df6fbb19dc09f134d08d16c46;hb=a8304d4c73fd04c338ae23f3028fc475921cc0fa;hp=f1c1bf3e94236fae070faaf136c91a0ee4a7d5a3;hpb=b7c06ae61dc99adc2d6e7fb1a95763a3fcb3ca02;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiFeedRecentChanges.php b/includes/api/ApiFeedRecentChanges.php index f1c1bf3e94..a2641ee646 100644 --- a/includes/api/ApiFeedRecentChanges.php +++ b/includes/api/ApiFeedRecentChanges.php @@ -52,6 +52,12 @@ class ApiFeedRecentChanges extends ApiBase { $this->dieUsage( 'Invalid subscription feed type', 'feed-invalid' ); } + $this->getMain()->setCacheMode( 'public' ); + if ( !$this->getMain()->getParameter( 'smaxage' ) ) { + // bug 63249: This page gets hit a lot, cache at least 15 seconds. + $this->getMain()->setCacheMaxAge( 15 ); + } + $feedFormat = $this->params['feedformat']; $specialClass = $this->params['target'] !== null ? 'SpecialRecentchangeslinked' @@ -80,6 +86,10 @@ class ApiFeedRecentChanges extends ApiBase { public function getFeedObject( $feedFormat, $specialClass ) { if ( $specialClass === 'SpecialRecentchangeslinked' ) { $title = Title::newFromText( $this->params['target'] ); + if ( !$title ) { + $this->dieUsageMsg( array( 'invalidtitle', $this->params['target'] ) ); + } + $feed = new ChangesFeed( $feedFormat, false ); $feedObj = $feed->getFeedObject( $this->msg( 'recentchangeslinked-title', $title->getPrefixedText() )