With a reasonable communication speed, the latency and overhead associated with the additional request will probably outweigh the gain without downloading a small amount (hopefully, reduced and gzipped) of text data, which, however, is not required for this user to display a page with this resolution. See Ilya Grigorik's excellent latency publication for more details on how this is a major performance limitation for many users.
The delay in additional data will be especially relevant for users on mobile devices (who will save their radios if they are not used), and even more so on 2G or 3G mobile connections, which have a relatively high cost when creating a connection (4G, apparently, is significantly improves it).
The key, like all of these things, is testing and measuring, but I would almost certainly expect that combining styles would be faster for your users. Do not forget every valid stylesheet ( where the media query evaluates to true ) will block the page rendering.
Itβs also worth noting that Ilya (who works at Google, therefore, should know) refers to the fact that WebKit will still load style-style queries that return false, albeit with a low priority and non-blocking manner.
if the media request evaluates to false, the stylesheet is marked NonBlocking and gets a very low download priority
and
The only caveat, as Scott points out, is that the browser will download all the included stylesheets, even if your deviceβs screen cannot exceed the width [cited]
Looking briefly at the webkit source, it looks like this is still happening, apparently for an instant response to screen rotation or window resizing.
// Load stylesheets that are not needed for the rendering immediately with low priority. 223 ResourceLoadPriority priority = isActive ? ResourceLoadPriorityUnresolved : ResourceLoadPriorityVeryLow; 224 CachedResourceRequest request(ResourceRequest(document().completeURL(url)), charset, priority); 225 request.setInitiator(this); 226 m_cachedSheet = document().cachedResourceLoader()->requestCSSStyleSheet(request);
For such questions, I can highly recommend High-performance browser networks that you can read online for free.
pwdst
source share