0

I am trying to use embedly cards to display urls in the topic index page of a rails app. While there are some issues with awkward carousel behavior the page itself will render (as confirmed by the rails console). However after the page loads each partial the browser will begin to flicker the loading/refresh icon and occasionally chrome will crash the page (as well as the cloud IDE I'm using)(internet explorer just seemed to lock up and even BSODed, though I'm not sure it was explicitly caused by that (also of note is that testing the page in internet explorer will crash the IDE in chrome while leaving all other tabs unaffected)). When the page does manage work through this (usually on the second or third load) the cards themselves will take around a full minute to display and it is only loading roughly 5 URLs 100 times for testing purposes. Several potential solutions come to mind regarding the slow load time, however I am not entirely sure how I would go about implementing them.

The first idea I had was to somehow render each card as is becomes available, though I'm not sure how that would work.

Another idea was to somehow break up the calls to the api because it appears to be attempting to load in all the card information at once. (this is probably the same as the first idea)

Potentially paginating the topic page might allow for a less intensive call (which may be a meaningless term) though I'm very unclear as to how the api works so this might not be the answer.

Another thought I had was to somehow make the api call(s?) a background process, but I'm not sure how I would go about that, and since all of the action seems to be happening on the client side that just compounds the mystery to me.

So to summarize, the javascript as I have it may crash the page, and when it does work it takes an unacceptably long time to load. Any way to speed it up and increase reliability would be appreciated.

All relevent code is at this gist as it is splayed across several partials and asset files.

Edit

Removed redundant (and probably harmful) loading of embedly in application.js

This improved page stability, however the page is clearly rendering/loading/(some verb here)ing all of the cards at once

4

1 に答える 1