4

So, I just ran Google's Page Speed on my website and received the following notice:

enter image description here

Can someone please tell me what that means? And how to "eliminate" those unnecessary reflows?

I also tried to use http://code.jquery.com/jquery-1.6.2.min.js instead, but it tells me the same thing.

Plus, I want to use https over http, so I'd rather stick with Google's CDN.

I hope this isn't a case of premature optimization? Just curious.

  • is that page you checked is in https or http? – naveen Aug 12 '11 at 17:09
  • @Rikudo, nah, I was just curious what it means? Because that's the first time I've actually seen it. I ran page speed a few months ago, and back then it didn't show up. And I tried to use both versions 1.6.1 and 1.6.2., anyway, thanks. –  Aug 12 '11 at 17:13

2 Answers2

4

A reflow happens any time the page changes. This means that the page re-renders. This can happen when you add something to the dom or change a property on an element. One of the best ways to eliminate reflows is to detach elements from the dom, make your changes, and then reattach.

John Kalberer
  • 5,690
  • 1
  • 23
  • 27
1

Well you are trying to access Google CDN the wrong way. The correct way will be

<script type="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.js"></script>

Note the lack of protocol. Per section 4.2 of RFC 3986, when the protocol is not specified, the protocol of the page will be used instead.

Read this: http://encosia.com/cripple-the-google-cdns-caching-with-a-single-character/

Community
  • 1
  • 1
naveen
  • 53,448
  • 46
  • 161
  • 251
  • Well, I wanna stick to https, because I'll be running the website via https later, anyway. And, it doesn't matter if I try to access it via http or https, it still gives me the same notice. And shouldn't it be ``? But, thanks, anyway. I'll read that blog post now. –  Aug 12 '11 at 17:27