Wikia code/opensearch desc.php
Appearance
This page is obsolete. It is being retained for archival purposes. It may document extensions or features that are obsolete and/or no longer supported. Do not rely on the information here being up-to-date. The information shown below refers to the now unmaintained 1.16 MediaWiki release. The current stable release number is 1.43.0. |
--- D:\Programming\SVN\mediawiki\branches\REL1_16\phase3\opensearch_desc.php 2011-07-18 22:35:03.389648500 +0100
+++ D:\Programming\SVN\wikia\trunk\opensearch_desc.php 2011-08-17 15:04:57.450195300 +0100
@@ -6,7 +6,7 @@
* @file
*/
-require_once( dirname(__FILE__) . '/includes/WebStart.php' );
+require( dirname(__FILE__) . '/includes/WebStart.php' );
if( $wgRequest->getVal( 'ctype' ) == 'application/xml' ) {
// Makes testing tweaks about a billion times easier
@@ -20,9 +20,12 @@
// Set an Expires header so that squid can cache it for a short time
// Short enough so that the sysadmin barely notices when $wgSitename is changed
-$expiryTime = 600; # 10 minutes
+$expiryTime = 86400; // 1 day
+// Note: We changed varnish to pass through X-Pass-Expires and X-Pass-Cache-Control to the client
$response->header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + $expiryTime ) . ' GMT' );
-$response->header( 'Cache-control: max-age=600' );
+$response->header( 'X-Pass-Expires: ' . gmdate( 'D, d M Y H:i:s', time() + $expiryTime ) . ' GMT' );
+$response->header( "Cache-Control: max-age=$expiryTime" );
+$response->header( "X-Pass-Cache-Control: max-age=$expiryTime" );
print '<?xml version="1.0"?>';
print Xml::openElement( 'OpenSearchDescription',