Gilles has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/215061

Change subject: Preload the logo using a link prefetch call
......................................................................

Preload the logo using a link prefetch call

This greatly increases the priority of loading
the logo on browsers that support link prefetching.

Bug: T100999
Change-Id: I0738fcc0a575153dab65016fa87faaa9b8b97a9d
---
M includes/OutputPage.php
1 file changed, 9 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/61/215061/1

diff --git a/includes/OutputPage.php b/includes/OutputPage.php
index a3a5a27..d2ec57e 100644
--- a/includes/OutputPage.php
+++ b/includes/OutputPage.php
@@ -3290,13 +3290,21 @@
         * @return array Array in format "link name or number => 'link html'".
         */
        public function getHeadLinksArray() {
-               global $wgVersion;
+               global $wgVersion, $wgLogo;
 
                $tags = array();
                $config = $this->getConfig();
 
                $canonicalUrl = $this->mCanonicalUrl;
 
+               if ( isset( $wgLogo ) ) {
+                       // Ask the preloader to fetch the logo ASAP since it's 
very prominent
+                       $tags['logo-prefetch'] = Html::element( 'link', array(
+                               'href' => $wgLogo,
+                               'rel' => 'prefetch'
+                       ) );
+               }
+
                $tags['meta-generator'] = Html::element( 'meta', array(
                        'name' => 'generator',
                        'content' => "MediaWiki $wgVersion",

-- 
To view, visit https://gerrit.wikimedia.org/r/215061
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0738fcc0a575153dab65016fa87faaa9b8b97a9d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Gilles <gdu...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to