Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does a deployed Meteor site take so long to load?

For a very simple application, my Meteor site is taking 4.1s to start downloading the first byte of data. This is with a very basic setup. The relevant times etc (taken from http://www.webpagetest.org) are:

IP: 107.22.210.133
Location: Ashburn, VA
Error/Status Code: 200
Start Offset: 0.121 s
DNS Lookup: 64 ms
Initial Connection: 56 ms
Time to First Byte: 4164 ms
Content Download: 247 ms
Bytes In (downloaded): 0.9 KB
Bytes Out (uploaded): 0.4 KB

Is this due to Meteor being slow, or is there likely to be a bottleneck in my code? Is there a way to determine this?

Thanks.

like image 561
cazgp Avatar asked Jan 15 '13 18:01

cazgp


1 Answers

That delay is a function of the time it takes your subscriptions to get data from the server. If any of the document data the client needs on page load is static, store it in unmanaged (unsynchronized) local collections so it is available immediately on initial page load. See collections.meteor.com for a load time comparison of data stored in an unmanaged versus a managed collection.

like image 157
ram1 Avatar answered Oct 08 '22 18:10

ram1