From 64bff5a33dc8d711485c9f89653beb883930bdfe Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 20 Mar 2004 02:35:08 +0000 Subject: [PATCH] Send cache-control headers with feeds, this makes 304 responses possible --- includes/Feed.php | 6 +++++- includes/QueryPage.php | 2 -- includes/SpecialRecentchanges.php | 2 -- 3 files changed, 5 insertions(+), 5 deletions(-) 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" ) ), -- 2.20.1