Load all CSS in the top queue
authorOri Livneh <ori@wikimedia.org>
Tue, 18 Aug 2015 17:54:44 +0000 (10:54 -0700)
committerOri Livneh <ori@wikimedia.org>
Tue, 18 Aug 2015 18:01:18 +0000 (11:01 -0700)
As the waterfall chart in
http://www.webpagetest.org/result/150817_ER_1E66/1/details/ clearly
demonstrates, the <link rel=stylesheet> for the bottom CSS queue is clearly
render-blocking. The fact that it is in the bottom of <body> only means the
browser discovers it later, when its connection to the server is already
saturated by requests for images that are referenced in the body HTML.

Change-Id: Icf0968c5984f4d3c3dbac1c7e1d539052fa5bd74

includes/OutputPage.php

index 8d4720b..80fd9ab 100644 (file)
@@ -3073,10 +3073,6 @@ class OutputPage extends ContextSource {
                        ResourceLoaderModule::TYPE_SCRIPTS
                );
 
-               $links[] = $this->makeResourceLoaderLink( $this->getModuleStyles( true, 'bottom' ),
-                       ResourceLoaderModule::TYPE_STYLES
-               );
-
                // Modules requests - let the client calculate dependencies and batch requests as it likes
                // Only load modules that have marked themselves for loading at the bottom
                $modules = $this->getModules( true, 'bottom' );
@@ -3668,7 +3664,7 @@ class OutputPage extends ContextSource {
                $otherTags = array(); // Tags to append after the normal <link> tags
                $resourceLoader = $this->getResourceLoader();
 
-               $moduleStyles = $this->getModuleStyles( true, 'top' );
+               $moduleStyles = $this->getModuleStyles( true );
 
                // Per-site custom styles
                $moduleStyles[] = 'site';