r94591 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94590‎ | r94591 | r94592 >
Date:23:33, 15 August 2011
Author:preilly
Status:ok
Tags:
Comment:
mft r94590
Modified paths:
  • /branches/wmf/1.17wmf1/extensions/MobileFrontend/MobileFrontend.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.17wmf1/extensions/MobileFrontend/MobileFrontend.php
@@ -49,7 +49,7 @@
5050 $wgHooks['SkinTemplateOutputPageBeforeExec'][] = array( &$wgExtMobileFrontend, 'addMobileFooter' );
5151
5252 class ExtMobileFrontend {
53 - const VERSION = '0.5.25';
 53+ const VERSION = '0.5.26';
5454
5555 /**
5656 * @var DOMDocument
@@ -341,6 +341,7 @@
342342 $mAction !== 'view_normal_site' ) {
343343 $this->getMsg();
344344 $this->disableCaching();
 345+ $this->sendXDeviceVaryHeader();
345346 ob_start( array( $this, 'DOMParse' ) );
346347 }
347348 }
@@ -376,6 +377,15 @@
377378 header( 'Pragma: no-cache' );
378379 }
379380 }
 381+
 382+ private function sendXDeviceVaryHeader() {
 383+ global $wgOut;
 384+
 385+ if ( !empty( $_SERVER['HTTP_X_DEVICE'] ) ) {
 386+ header( 'X-Device: ' . $_SERVER['HTTP_X_DEVICE'] );
 387+ $wgOut->addVaryHeader( 'X-Device' );
 388+ }
 389+ }
380390
381391 private function renderOptInMobileSiteXHTML() {
382392 if ( $this->contentFormat == 'XHTML' ) {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r94590add vary support for x-device to allow proper purging of varnish cachepreilly23:32, 15 August 2011

Status & tagging log