From: Brion Vibber Date: Sat, 20 Mar 2004 02:35:08 +0000 (+0000) Subject: Send cache-control headers with feeds, this makes 304 responses possible X-Git-Tag: 1.3.0beta1~769 X-Git-Url: http://git.cyclocoop.org/geomaker.php?a=commitdiff_plain;h=64bff5a33dc8d711485c9f89653beb883930bdfe;p=lhc%2Fweb%2Fwiklou.git Send cache-control headers with feeds, this makes 304 responses possible --- diff --git a/includes/Feed.php b/includes/Feed.php index e7539fce1d..590d9ca6cc 100644 --- a/includes/Feed.php +++ b/includes/Feed.php @@ -88,9 +88,13 @@ class RSSFeed extends ChannelFeed { } function outHeader() { - global $wgVersion; + global $wgVersion, $wgOut; + # We take over from $wgOut, excepting its cache header info + $wgOut->disable(); header( "Content-type: application/xml; charset=UTF-8" ); + $wgOut->sendCacheControl(); + print '<' . '?xml version="1.0" encoding="utf-8"?' . ">\n"; ?> diff --git a/includes/QueryPage.php b/includes/QueryPage.php index 93a13bf17d..6ba0339a60 100644 --- a/includes/QueryPage.php +++ b/includes/QueryPage.php @@ -94,8 +94,6 @@ class QueryPage { global $wgFeedClasses; global $wgOut, $wgLanguageCode, $wgLang; if( $class == "rss" ) { - $wgOut->disable(); - $feed = new RSSFeed( $this->feedTitle(), $this->feedDesc(), diff --git a/includes/SpecialRecentchanges.php b/includes/SpecialRecentchanges.php index 46a57071a4..68e0db6a5d 100644 --- a/includes/SpecialRecentchanges.php +++ b/includes/SpecialRecentchanges.php @@ -126,8 +126,6 @@ function wfSpecialRecentchanges( $par ) $wgOut->addHTML( "{$note}\n" ); if( $feeding ) { - $wgOut->disable(); - $feed = new RSSFeed( $wgSitename . " - " . wfMsg( "recentchanges" ) . " [" . $wgLanguageCode . "]", htmlspecialchars( wfMsg( "recentchangestext" ) ),