Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #27656

Re: Google developers pagespeed insights - can't optimize css

From "Christoph M. Becker" <cmbecker69@arcor.de>
Newsgroups comp.lang.javascript
Subject Re: Google developers pagespeed insights - can't optimize css
Date 2015-05-16 02:03 +0200
Organization solani.org
Message-ID <mj61fa$fak$1@solani.org> (permalink)
References <f421b972-432d-40b7-bed1-d7f496121325@googlegroups.com> <mj5vkv$8nt$1@solani.org> <a74f7a2d-8f45-4895-9c28-463622048083@googlegroups.com>

Show all headers | View raw


lazar@convexicon.com wrote:

> On Saturday, May 16, 2015 at 2:31:47 AM UTC+3, Christoph M. Becker wrote:
>
>> lazar@convexicon.com wrote:
>>
>>> "Eliminate render-blocking JavaScript and CSS in above-the-fold
>>> content Your page has 1 blocking CSS resources. This causes a delay
>>> in rendering your page."
>>
>> A blocking CSS resource? o_O
> 
> Here's what I tried:
> 
> $(window).load(function() {
>    $('head').append('<link rel="stylesheet" href="style.css" />');
> })

If I'm not mistaken, a linked CSS resource should never block, but
rather be downloaded, parsed and applied asynchronously.  That's
contrary to any client side script resources (e.g. JavaScript
resources), which have to be blocking (unless explicitly stated) due to
potentially writing to the document (e.g. document.write()).

Adding a link element on window load doesn't seem to be a good idea,
because you're risking a FOUC this way.

Anyhow, it might be best if you can post a link to the site – the "finer
details" might matter.

-- 
Christoph M. Becker

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Google developers pagespeed insights - can't optimize css lazar@convexicon.com - 2015-05-15 07:16 -0700
  Re: Google developers pagespeed insights - can't optimize css "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-05-15 16:55 +0200
    Re: Google developers pagespeed insights - can't optimize css lazar@convexicon.com - 2015-05-15 15:10 -0700
      Re: Google developers pagespeed insights - can't optimize css "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2015-05-16 00:52 +0200
  Re: Google developers pagespeed insights - can't optimize css "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-05-16 01:31 +0200
    Re: Google developers pagespeed insights - can't optimize css lazar@convexicon.com - 2015-05-15 16:49 -0700
      Re: Google developers pagespeed insights - can't optimize css "Christoph M. Becker" <cmbecker69@arcor.de> - 2015-05-16 02:03 +0200
      Re: Google developers pagespeed insights - can't optimize css Denis McMahon <denismfmcmahon@gmail.com> - 2015-05-16 21:32 +0000
  Re: Google developers pagespeed insights - can't optimize css Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2015-05-15 23:12 -0300
    Re: Google developers pagespeed insights - can't optimize css Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2015-05-16 09:59 +0200

csiph-web