-4

Im working on a college project thats going well apart from a problem with slowness. It seems to take forever to load.

I have a feeling that im not deploying it properly or something else is slowing it down. Its deployed to a Heroku Hobby server which $7 a month and never has to go to sleep.

How would i properly check through chrome inspect or somethign similar whats causing it to take 20 seconds to see anything?

ChrisM
  • 706
  • 11
  • 30
  • 2
    please provide a [mcve] – Daniel A. White Apr 13 '16 at 00:27
  • 3
    You have 68 script tags on your homepage. Each one of those ends up being a separate HTTP request, which certainly will slow down your page this must. (For what it's worth, it loaded for me after about 2 seconds). – TAGraves Apr 13 '16 at 00:29
  • Normally the clients cache is used to store pages and images used often. It is usually safe to store these for months (multiple sessions) before they time-out. Session cookies are erased when each session is over. –  Apr 13 '16 at 00:29
  • It loaded in about 3 seconds for me. That is 10 times the script tags I normally see, even on an automated page. –  Apr 13 '16 at 00:35
  • Thanks. Are you saying it was usable after 3 seconds? Ive noticed it loads a lot quicker on Firefox also. – ChrisM Apr 13 '16 at 01:02

2 Answers2

2

For me, the page took 9.85s to load the DOM content and 33.91s to fully load. I should also note that I'm in Korea, so it may take slightly longer for me.

Like the others have said, you have far too many script tags. Each is making their own request and they have to wait until the previous request is finished before the next one can fire off.

To drastically speed up the time, I would suggest to concatenate and minify your scripts into as few scripts as possible. Maybe one bundle for third party scripts and another for all of your scripts. Also, cache them if you can.

Mr_Antivius
  • 625
  • 6
  • 17
  • Is there some kind of online service i can use to join the scripts or how would i go about it? – ChrisM Apr 13 '16 at 01:04
  • Take a look at http://stackoverflow.com/questions/6539837/concat-and-minify-js-files-in-node - the answers about UglifyJS2 are where you want to look. – TAGraves Apr 13 '16 at 01:24
  • I am unsure what backend you are using so it's hard to recommend what to use for minification and concatenation. If it's Node, there are various packages such as UglifyJS2 like @TAGraves mentioned. If you just want to use some online service, I'm not too sure what is good out there since I haven't used any. I did a quick search and found [JSCompress](http://jscompress.com/) which uses UglifyJS2. – Mr_Antivius Apr 13 '16 at 02:53
0

The networking, and auditing tabs on Chrome DevTools (inspect) can help find your issue, which definitely seems to be the amount of scripts you have loading.

Networking enter image description here

Audit enter image description here

Adam Forbis
  • 461
  • 3
  • 11