mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 22:35:41 +00:00
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:
parent
993c7ecfe5
commit
28a293ebaf
|
@ -94,9 +94,10 @@ class ApiVisualEditor extends ApiBase {
|
|||
// served directly from Varnish, in which case discard the value of the XPP header
|
||||
// and use it to declare the cache hit instead.
|
||||
$headers = $response['headers'];
|
||||
$xpp = null;
|
||||
if ( isset( $headers['x-cache'] ) && strpos( $headers['x-cache'], 'hit' ) !== false ) {
|
||||
$xpp = 'cached-response=true';
|
||||
} else {
|
||||
} elseif ( isset( $headers['x-parsoid-performance'] ) ) {
|
||||
$xpp = $headers['x-parsoid-performance'];
|
||||
}
|
||||
if ( $xpp !== null ) {
|
||||
|
|
Loading…
Reference in a new issue