Don't try to access x-parsoid-performance on restbase cache hits

It doesn't get set

Change-Id: I6695ab0e7d461b7541dd56e392f8d1479998f2b5
This commit is contained in:
Alex Monk 2015-03-13 00:52:52 +00:00
parent 993c7ecfe5
commit 28a293ebaf

View file

@ -94,9 +94,10 @@ class ApiVisualEditor extends ApiBase {
// served directly from Varnish, in which case discard the value of the XPP header // served directly from Varnish, in which case discard the value of the XPP header
// and use it to declare the cache hit instead. // and use it to declare the cache hit instead.
$headers = $response['headers']; $headers = $response['headers'];
$xpp = null;
if ( isset( $headers['x-cache'] ) && strpos( $headers['x-cache'], 'hit' ) !== false ) { if ( isset( $headers['x-cache'] ) && strpos( $headers['x-cache'], 'hit' ) !== false ) {
$xpp = 'cached-response=true'; $xpp = 'cached-response=true';
} else { } elseif ( isset( $headers['x-parsoid-performance'] ) ) {
$xpp = $headers['x-parsoid-performance']; $xpp = $headers['x-parsoid-performance'];
} }
if ( $xpp !== null ) { if ( $xpp !== null ) {