* (bug 22496) Viewing diff of a redirect page without specifying "oldid"
parameter no longer makes the page displayed as being the redirect target
* (bug 22918) Feed cache keys now use $wgRenderHashAppend
+* (bug 21916) Last-Modified header is now correct when outputting cached feed
=== API changes in 1.17 ===
* (bug 22738) Allow filtering by action type on query=logevent
* @return feed's content on cache hit or false on cache miss
*/
public function loadFromCache( $lastmod, $timekey, $key ) {
- global $wgFeedCacheTimeout, $messageMemc;
+ global $wgFeedCacheTimeout, $wgOut, $messageMemc;
+
$feedLastmod = $messageMemc->get( $timekey );
if( ( $wgFeedCacheTimeout > 0 ) && $feedLastmod ) {
if( $feedAge < $wgFeedCacheTimeout || $feedLastmodUnix > $lastmodUnix) {
wfDebug( "RC: loading feed from cache ($key; $feedLastmod; $lastmod)...\n" );
+ if ( $feedLastmodUnix < $lastmodUnix ) {
+ $wgOut->setLastModified( $feedLastmod ); // bug 21916
+ }
return $messageMemc->get( $key );
} else {
wfDebug( "RC: cached feed timestamp check failed ($feedLastmod; $lastmod)\n" );
return true;
}
+ /**
+ * Override the last modified timestamp
+ *
+ * @param $timestamp String: new timestamp, in a format readable by
+ * wfTimestamp()
+ */
+ public function setLastModified( $timestamp ) {
+ $this->mLastModified = wfTimestamp( TS_RFC2822, $timestamp );
+ }
+
/**
* Set the robot policy for the page: <http://www.robotstxt.org/meta.html>