to display the old format for compatibility.
* (bug 7357) Make supposedly static methods of Skin actually static
* Added info text to Special:Deadendpages and Special:Lonelypages
+* Fix regression in cachability of generated CSS and JS for MonoBook skin,
+ while avoiding clobbering of different users' cached data
== Languages updated ==
function RawPage( &$article, $request = false ) {
global $wgRequest, $wgInputEncoding, $wgSquidMaxage, $wgJsMimeType;
+ global $wgUser;
$allowedCTypes = array('text/x-wiki', $wgJsMimeType, 'text/css', 'application/x-zope-edit');
$this->mArticle =& $article;
$this->mCharset = $wgInputEncoding;
$this->mSmaxage = intval( $smaxage );
$this->mMaxage = $maxage;
+
+ // Output may contain user-specific data; vary for open sessions
+ $this->mPrivateCache = ( $this->mSmaxage == 0 ) ||
+ ( isset( $_COOKIE[ini_get( 'session.name' )] ) ||
+ $wgUser->isLoggedIn() );
+
if ( $ctype == '' or ! in_array( $ctype, $allowedCTypes ) ) {
$this->mContentType = 'text/x-wiki';
} else {
header( "Content-type: ".$this->mContentType.'; charset='.$this->mCharset );
# allow the client to cache this for 24 hours
- header( 'Cache-Control: s-maxage='.$this->mSmaxage.', max-age='.$this->mMaxage );
+ $mode = $this->mPrivateCache ? 'private' : 'public';
+ header( 'Cache-Control: '.$mode.', s-maxage='.$this->mSmaxage.', max-age='.$this->mMaxage );
echo $this->getRawText();
$wgOut->disable();
}
function getRawText() {
global $wgUser, $wgOut, $wgRequest;
if($this->mGen) {
- // May contain user-specific data; vary for open sessions
- $wgRequest->response()->header( 'Vary: Accept-Encoding, Cookie' );
$sk = $wgUser->getSkin();
$sk->initPage($wgOut);
if($this->mGen == 'css') {
$sitecss = '';
$usercss = '';
$siteargs = '&maxage=' . $wgSquidMaxage;
+ if( $this->loggedin ) {
+ // Ensure that logged-in users' generated CSS isn't clobbered
+ // by anons' publicly cacheable generated CSS.
+ $siteargs .= '&smaxage=0';
+ }
# Add user-specific code if this is a user and we allow that kind of thing