19

ws://sockets.ny.stackexchange.com/ seems to cause all of the Stack Oveflow pages to take a while to "load" (by "load" I mean that the browser tab stays for a while like this: )

It takes approximately 1.4 minutes for it to fully load:

Here is my browser information:

Google Chrome   28.0.1500.72 (Official Build 211400) m
OS  Windows 
Blink   537.36 (@153022)
JavaScript  V8 3.18.5.9
Flash   11.8.800.97
User Agent  Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.72 Safari/537.36

For all you who might say it has to do with my internet speed:

2
  • What proxy are you behind? This doesn't happen to me (GC/Win7). I do get 502s on a Vodafone network, however Jul 18, 2013 at 13:59
  • @JanDvorak I am behind my office's proxy although I have never had this issue before.
    – Naftali
    Jul 18, 2013 at 14:00

2 Answers 2

39

I'm 99% sure Web Sockets will always show "pending" in Chrome's web developer tools because the request never actually completes. The 101 Switching Protocol is what is actually driving the request.

If it's still requesting something, it probably isn't the websocket connection. (it's pending for me, and no loading animation)

9
  • 1
    Yes, but then why does the page "load" for about one and a half minutes?
    – Naftali
    Jul 18, 2013 at 14:03
  • 2
    @amanaPlanaCAnalPAnaMA You aren't using a 1200bd modem, are you? ;) Jul 18, 2013 at 14:05
  • @amanaPlanaCAnalPAnaMA I'm going to guess something else is waiting to do something. Maybe an ajax call that fires at page load? It says pending for me in Chrome 28 and the request has completed.
    – Steven V
    Jul 18, 2013 at 14:05
  • 7
    @AndrewBarber Nooo, I do not think so...
    – Naftali
    Jul 18, 2013 at 14:07
  • @amanaPlanaCAnalPAnaMA Yes... seems to be slightly faster than one of those! (and makes our 100Mb fiber here look slow!) Jul 18, 2013 at 14:10
  • @AndrewBarber ^_^
    – Naftali
    Jul 18, 2013 at 14:10
  • 5
    This is correct.
    – balpha StaffMod
    Jul 19, 2013 at 7:24
  • This is true. I recently faced this issue and doubted on sockets, but on other pages the reloading thing wasn't happening, but no other request as well was showing up. I got really confused and frustated. Then I checked in the code that for image src with incorrect path and onerror trigger for incorrect path was also incorrect, some how, it got stuck in loop and page kept reloading. Mind you, I also stopped my server, but didn't help as well, as soon as I commented img tag, the page loading stopped, and everything worked just fine.
    – Satys
    May 16, 2018 at 8:49
  • Or may be you check you src attribute of your image tags, if they are unknown, they should be corrected. This is purely based on observation of what I encountered.
    – Satys
    May 16, 2018 at 12:19
10

"Pending" is a valid state for WebSockets. You can see the TCP frames being sent and received using the Chrome tools.

enter image description here

2
  • I see the Data column here, is that the data sent by the server? Jul 2, 2017 at 22:53
  • @AftabNaveed Yes. Jul 9, 2017 at 5:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .