What are the sockjs JSONP requests when loading a Meteor page, and how can I optimise the download speed?

StackOverflow https://stackoverflow.com/questions/14342973

Question

The attached image is from http://www.webpagetest.org/. I am developing a real site, and it's taking ~10s to download. I then created a very basic site to see what was happening, and ran the speed test. It's taking over 2s to download these files, and I'm not sure what they are, or how to change my application to reduce the page load time.

The (relevant?) info for number 13 is:

URL: https://ddp--6189--50f5840c089282031a00a004.meteor.com/sockjs/632/7ke6oz_0/jsonp?c=_jp.a2ujpxq
Host: ddp--6189--50f5840c089282031a00a004.meteor.com
IP: 107.21.116.12
Location: Ashburn, VA
Error/Status Code: 200
Start Offset: 4.652 s
Time to First Byte: 25065 ms
Content Download: 256 ms
Bytes In (downloaded): 0.5 KB
Bytes Out (uploaded): 0.5 KB

GET /sockjs/632/7ke6oz_0/jsonp?c=_jp.a2ujpxq HTTP/1.1
Accept: */*
Accept-Language: en-US
Host: ddp--6189--50f5840c089282031a00a004.meteor.com
Connection: Keep-Alive

Any tips or pointers would be great, thanks.

Waterfall of JSONP downloads

Was it helpful?

Solution

That's actually SockJS keeping a communication channel open between the browser and the web server, it's not downloading as such - note the reduced bandwidth you're seeing in your BandwidthIn graph after the first socket event (your line 13).

Here's a little more info via SockJS - https://github.com/sockjs/sockjs-client :

SockJS is a browser JavaScript library that provides a WebSocket-like object. SockJS gives you a coherent, cross-browser, Javascript API which creates a low latency, full duplex, cross-domain communication channel between the browser and the web server.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top